home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 …ember: Reference Library / Dev.CD Dec 94.toast / Technical Documentation / Mac Tech Notes (DocViewer) / ME • Memory / ME09 VM and Memory Mappings < prev    next >
MacBinary  |  1994-10-19  |  109.6 KB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Oct 6 09:15:43 1994, modified Wed Oct 19 11:24:38 1994, creator 'HLX2', type 'ONLN', 109136 bytes "ME09 VM and Memory Mappings" , at 0x1aad0 2818 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 1b 4d 45 30 39 20 56 | 4d 20 61 6e 64 20 4d 65 |..ME09 V|M and Me|
|00000010| 6d 6f 72 79 20 4d 61 70 | 70 69 6e 67 73 00 00 00 |mory Map|pings...|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 01 aa 50 00 | 00 0b 02 aa b9 a8 ff aa |......P.|........|
|00000060| ca ea b6 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 32 6f 00 00 |........|....2o..|
|00000080| 4d 45 20 39 20 2d 20 43 | 6f 70 69 6e 67 20 57 69 |ME 9 - C|oping Wi|
|00000090| 74 68 20 56 4d 20 61 6e | 64 20 4d 65 6d 6f 72 79 |th VM an|d Memory|
|000000a0| 20 4d 61 70 70 69 6e 67 | 73 0d 4d 65 6d 6f 72 79 | Mapping|s.Memory|
|000000b0| 09 0d 52 65 76 69 73 65 | 64 20 62 79 3a 09 43 72 |..Revise|d by:.Cr|
|000000c0| 61 69 67 20 50 72 6f 75 | 73 65 09 41 70 72 69 6c |aig Prou|se.April|
|000000d0| 20 31 39 39 31 0d 57 72 | 69 74 74 65 6e 20 62 79 | 1991.Wr|itten by|
|000000e0| 3a 09 43 72 61 69 67 20 | 50 72 6f 75 73 65 09 46 |:.Craig |Prouse.F|
|000000f0| 65 62 72 75 61 72 79 20 | 31 39 39 31 0d 54 68 65 |ebruary |1991.The|
|00000100| 20 70 75 72 70 6f 73 65 | 20 6f 66 20 74 68 69 73 | purpose| of this|
|00000110| 20 4e 6f 74 65 20 69 73 | 20 74 77 6f 66 6f 6c 64 | Note is| twofold|
|00000120| 2e 20 20 46 69 72 73 74 | 2c 20 69 74 20 64 65 73 |. First|, it des|
|00000130| 63 72 69 62 65 73 20 69 | 6e 20 64 65 74 61 69 6c |cribes i|n detail|
|00000140| 20 68 6f 77 20 74 6f 20 | 75 73 65 20 74 68 65 20 | how to |use the |
|00000150| 47 65 74 50 68 79 73 69 | 63 61 6c 20 72 6f 75 74 |GetPhysi|cal rout|
|00000160| 69 6e 65 2e 20 20 54 68 | 69 73 20 72 6f 75 74 69 |ine. Th|is routi|
|00000170| 6e 65 20 69 73 20 63 72 | 69 74 69 63 61 6c 20 74 |ne is cr|itical t|
|00000180| 6f 20 74 68 65 20 73 75 | 70 70 6f 72 74 20 6f 66 |o the su|pport of|
|00000190| 20 61 6c 74 65 72 6e 61 | 74 65 20 62 75 73 20 6d | alterna|te bus m|
|000001a0| 61 73 74 65 72 73 20 6f | 6e 20 63 65 72 74 61 69 |asters o|n certai|
|000001b0| 6e 20 6d 61 63 68 69 6e | 65 73 20 77 69 74 68 6f |n machin|es witho|
|000001c0| 75 74 20 56 69 72 74 75 | 61 6c 20 4d 65 6d 6f 72 |ut Virtu|al Memor|
|000001d0| 79 20 28 56 4d 29 20 61 | 6e 64 20 61 6c 6c 20 6d |y (VM) a|nd all m|
|000001e0| 61 63 68 69 6e 65 73 20 | 77 69 74 68 20 56 4d 2e |achines |with VM.|
|000001f0| 20 20 49 6e 63 6c 75 64 | 65 64 20 69 73 20 61 6e | Includ|ed is an|
|00000200| 20 61 6e 63 69 6c 6c 61 | 72 79 20 64 69 73 63 75 | ancilla|ry discu|
|00000210| 73 73 69 6f 6e 20 6f 66 | 20 73 65 76 65 72 61 6c |ssion of| several|
|00000220| 20 63 6c 6f 73 65 6c 79 | 2d 72 65 6c 61 74 65 64 | closely|-related|
|00000230| 20 56 4d 20 72 6f 75 74 | 69 6e 65 73 2e 20 20 53 | VM rout|ines. S|
|00000240| 65 63 6f 6e 64 2c 20 69 | 74 20 72 65 69 74 65 72 |econd, i|t reiter|
|00000250| 61 74 65 73 20 61 20 6e | 75 6d 62 65 72 20 6f 66 |ates a n|umber of|
|00000260| 20 69 73 73 75 65 73 20 | 69 6d 70 6f 72 74 61 6e | issues |importan|
|00000270| 74 20 74 6f 20 56 4d 20 | 63 6f 6d 70 61 74 69 62 |t to VM |compatib|
|00000280| 69 6c 69 74 79 20 61 6e | 64 20 65 6c 75 63 69 64 |ility an|d elucid|
|00000290| 61 74 65 73 20 73 6f 6d | 65 20 6f 66 20 74 68 65 |ates som|e of the|
|000002a0| 20 64 65 65 70 65 72 20 | 56 4d 20 69 73 73 75 65 | deeper |VM issue|
|000002b0| 73 20 6f 66 20 77 68 69 | 63 68 20 73 70 65 63 69 |s of whi|ch speci|
|000002c0| 61 6c 69 7a 65 64 20 64 | 65 76 65 6c 6f 70 65 72 |alized d|eveloper|
|000002d0| 73 20 73 68 6f 75 6c 64 | 20 62 65 20 61 77 61 72 |s should| be awar|
|000002e0| 65 2e 20 20 43 6f 6d 70 | 61 74 69 62 69 6c 69 74 |e. Comp|atibilit|
|000002f0| 79 20 69 73 73 75 65 73 | 20 61 72 65 20 65 73 70 |y issues| are esp|
|00000300| 65 63 69 61 6c 6c 79 20 | 69 6d 70 6f 72 74 61 6e |ecially |importan|
|00000310| 74 20 66 6f 72 20 64 65 | 76 65 6c 6f 70 65 72 73 |t for de|velopers|
|00000320| 20 6f 66 20 53 43 53 49 | 20 64 72 69 76 65 72 73 | of SCSI| drivers|
|00000330| 2c 20 4e 75 42 75 73 aa | 20 6d 61 73 74 65 72 20 |, NuBus.| master |
|00000340| 68 61 72 64 77 61 72 65 | 2c 20 61 6e 64 20 63 6f |hardware|, and co|
|00000350| 64 65 20 77 68 69 63 68 | 20 72 75 6e 73 20 61 74 |de which| runs at|
|00000360| 20 69 6e 74 65 72 72 75 | 70 74 20 74 69 6d 65 2e | interru|pt time.|
|00000370| 0d 43 68 61 6e 67 65 73 | 20 73 69 6e 63 65 20 46 |.Changes| since F|
|00000380| 65 62 72 75 61 72 79 20 | 20 31 39 39 31 3a 20 54 |ebruary | 1991: T|
|00000390| 68 69 73 20 75 70 64 61 | 74 65 20 69 6e 63 6f 72 |his upda|te incor|
|000003a0| 70 6f 72 61 74 65 73 20 | 6e 65 77 20 69 73 73 75 |porates |new issu|
|000003b0| 65 73 20 77 68 69 63 68 | 20 68 61 76 65 20 63 6f |es which| have co|
|000003c0| 6d 65 20 75 70 20 64 75 | 72 69 6e 67 20 53 79 73 |me up du|ring Sys|
|000003d0| 74 65 6d 20 37 2e 30 20 | 62 65 74 61 20 74 65 73 |tem 7.0 |beta tes|
|000003e0| 74 69 6e 67 2c 20 61 6e | 64 20 69 74 20 61 6c 73 |ting, an|d it als|
|000003f0| 6f 20 61 74 74 65 6d 70 | 74 73 20 74 6f 20 63 6c |o attemp|ts to cl|
|00000400| 61 72 69 66 79 20 73 6f | 6d 65 20 69 73 73 75 65 |arify so|me issue|
|00000410| 73 20 77 68 69 63 68 20 | 68 61 76 65 20 70 72 6f |s which |have pro|
|00000420| 76 65 6e 20 74 6f 20 62 | 65 20 70 61 72 74 69 63 |ven to b|e partic|
|00000430| 75 6c 61 72 6c 79 20 74 | 72 6f 75 62 6c 65 73 6f |ularly t|roubleso|
|00000440| 6d 65 20 6f 72 20 77 69 | 64 65 6c 79 20 6d 69 73 |me or wi|dely mis|
|00000450| 75 6e 64 65 72 73 74 6f | 6f 64 2e 0d 45 76 65 72 |understo|od..Ever|
|00000460| 79 62 6f 64 79 20 4d 75 | 73 74 20 47 65 74 20 50 |ybody Mu|st Get P|
|00000470| 68 79 73 69 63 61 6c 0d | 49 66 20 79 6f 75 20 61 |hysical.|If you a|
|00000480| 72 65 20 64 65 76 65 6c | 6f 70 69 6e 67 20 4e 75 |re devel|oping Nu|
|00000490| 42 75 73 20 65 78 70 61 | 6e 73 69 6f 6e 20 63 61 |Bus expa|nsion ca|
|000004a0| 72 64 73 20 77 69 74 68 | 20 62 75 73 20 6d 61 73 |rds with| bus mas|
|000004b0| 74 65 72 73 68 69 70 20 | 6f 72 20 64 69 72 65 63 |tership |or direc|
|000004c0| 74 20 6d 65 6d 6f 72 79 | 20 61 63 63 65 73 73 20 |t memory| access |
|000004d0| 28 44 4d 41 29 20 63 61 | 70 61 62 69 6c 69 74 69 |(DMA) ca|pabiliti|
|000004e0| 65 73 2c 20 61 6e 64 20 | 69 66 20 79 6f 75 20 68 |es, and |if you h|
|000004f0| 61 76 65 20 65 76 65 72 | 20 64 6f 6e 65 20 64 65 |ave ever| done de|
|00000500| 76 65 6c 6f 70 6d 65 6e | 74 20 6f 72 20 63 6f 6d |velopmen|t or com|
|00000510| 70 61 74 69 62 69 6c 69 | 74 79 20 74 65 73 74 69 |patibili|ty testi|
|00000520| 6e 67 20 77 69 74 68 20 | 41 70 70 6c 65 d5 73 20 |ng with |Apple.s |
|00000530| 72 65 63 65 6e 74 20 6d | 61 63 68 69 6e 65 73 2c |recent m|achines,|
|00000540| 20 6c 69 6b 65 20 74 68 | 65 20 4d 61 63 69 6e 74 | like th|e Macint|
|00000550| 6f 73 68 20 49 49 63 69 | 20 61 6e 64 20 4d 61 63 |osh IIci| and Mac|
|00000560| 69 6e 74 6f 73 68 20 49 | 49 73 69 2c 20 79 6f 75 |intosh I|Isi, you|
|00000570| 20 68 61 76 65 20 75 6e | 64 6f 75 62 74 65 64 6c | have un|doubtedl|
|00000580| 79 20 6e 6f 74 69 63 65 | 64 20 73 6f 6d 65 20 73 |y notice|d some s|
|00000590| 74 72 61 6e 67 65 20 62 | 65 68 61 76 69 6f 72 2e |trange b|ehavior.|
|000005a0| 20 20 59 6f 75 20 6d 69 | 67 68 74 20 74 65 6c 6c | You mi|ght tell|
|000005b0| 20 74 68 65 20 63 61 72 | 64 20 74 6f 20 64 75 6d | the car|d to dum|
|000005c0| 70 20 64 61 74 61 20 69 | 6e 74 6f 20 61 20 62 75 |p data i|nto a bu|
|000005d0| 66 66 65 72 20 61 74 20 | 24 30 30 33 30 30 30 30 |ffer at |$0030000|
|000005e0| 30 20 61 6e 64 20 74 68 | 65 20 64 61 74 61 20 69 |0 and th|e data i|
|000005f0| 6e 73 74 65 61 64 20 61 | 70 70 65 61 72 73 20 61 |nstead a|ppears a|
|00000600| 74 20 24 30 30 36 42 30 | 30 30 30 2e 20 20 d2 57 |t $006B0|000. .W|
|00000610| 68 61 74 d5 73 20 68 61 | 70 70 65 6e 69 6e 67 20 |hat.s ha|ppening |
|00000620| 68 65 72 65 3f d3 20 79 | 6f 75 20 6d 75 73 74 20 |here?. y|ou must |
|00000630| 61 73 6b 20 79 6f 75 72 | 73 65 6c 66 2e 0d 57 65 |ask your|self..We|
|00000640| 6c 6c 2c 20 74 68 65 72 | 65 d5 73 20 61 20 6e 65 |ll, ther|e.s a ne|
|00000650| 77 20 67 61 6d 65 20 69 | 6e 20 74 6f 77 6e d1 69 |w game i|n town.i|
|00000660| 74 d5 73 20 63 61 6c 6c | 65 64 20 61 20 64 69 73 |t.s call|ed a dis|
|00000670| 63 6f 6e 74 69 67 75 6f | 75 73 20 70 68 79 73 69 |contiguo|us physi|
|00000680| 63 61 6c 20 61 64 64 72 | 65 73 73 20 73 70 61 63 |cal addr|ess spac|
|00000690| 65 2e 20 20 57 68 61 74 | 20 74 68 61 74 20 6d 65 |e. What| that me|
|000006a0| 61 6e 73 20 69 6e 20 73 | 69 6d 70 6c 65 20 74 65 |ans in s|imple te|
|000006b0| 72 6d 73 20 69 73 20 74 | 68 61 74 20 74 68 65 72 |rms is t|hat ther|
|000006c0| 65 20 69 73 20 70 6f 74 | 65 6e 74 69 61 6c 6c 79 |e is pot|entially|
|000006d0| 20 61 20 62 69 67 20 68 | 6f 6c 65 20 69 6e 20 6d | a big h|ole in m|
|000006e0| 65 6d 6f 72 79 2e 20 20 | 49 66 20 79 6f 75 20 68 |emory. |If you h|
|000006f0| 61 76 65 20 65 69 67 68 | 74 20 6d 65 67 61 62 79 |ave eigh|t megaby|
|00000700| 74 65 73 20 69 6e 73 74 | 61 6c 6c 65 64 20 69 6e |tes inst|alled in|
|00000710| 20 61 20 4d 61 63 69 6e | 74 6f 73 68 20 49 49 63 | a Macin|tosh IIc|
|00000720| 69 2c 20 66 6f 72 20 69 | 6e 73 74 61 6e 63 65 2c |i, for i|nstance,|
|00000730| 20 74 68 61 74 20 6d 65 | 6d 6f 72 79 20 61 70 70 | that me|mory app|
|00000740| 65 61 72 73 20 74 6f 20 | 74 68 65 20 43 50 55 20 |ears to |the CPU |
|00000750| 61 6e 64 20 74 6f 20 4e | 75 42 75 73 20 69 6e 20 |and to N|uBus in |
|00000760| 74 77 6f 20 73 65 70 61 | 72 61 74 65 20 34 20 4d |two sepa|rate 4 M|
|00000770| 42 20 72 61 6e 67 65 73 | 3a 20 5b 24 30 30 30 30 |B ranges|: [$0000|
|00000780| 30 30 30 30 20 d0 20 24 | 30 30 33 46 46 46 46 46 |0000 . $|003FFFFF|
|00000790| 5d 20 61 6e 64 20 5b 24 | 30 34 30 30 30 30 30 30 |] and [$|04000000|
|000007a0| 20 d0 20 24 30 34 33 46 | 46 46 46 46 5d 2e 20 20 | . $043F|FFFF]. |
|000007b0| 45 76 65 72 79 74 68 69 | 6e 67 20 66 72 6f 6d 20 |Everythi|ng from |
|000007c0| 74 68 65 20 65 6e 64 20 | 6f 66 20 42 61 6e 6b 20 |the end |of Bank |
|000007d0| 41 20 74 6f 20 74 68 65 | 20 62 65 67 69 6e 6e 69 |A to the| beginni|
|000007e0| 6e 67 20 6f 66 20 42 61 | 6e 6b 20 42 20 69 73 20 |ng of Ba|nk B is |
|000007f0| 65 73 73 65 6e 74 69 61 | 6c 6c 79 20 65 6d 70 74 |essentia|lly empt|
|00000800| 79 2e 20 42 61 6e 6b 20 | 42 20 6d 65 6d 6f 72 79 |y. Bank |B memory|
|00000810| 20 64 6f 65 73 20 6e 6f | 74 20 73 74 61 72 74 20 | does no|t start |
|00000820| 75 6e 74 69 6c 20 61 74 | 20 6c 65 61 73 74 20 24 |until at| least $|
|00000830| 30 34 30 30 30 30 30 30 | 2e 0d 54 6f 20 63 6f 6d |04000000|..To com|
|00000840| 70 65 6e 73 61 74 65 20 | 66 6f 72 20 74 68 69 73 |pensate |for this|
|00000850| 2c 20 74 68 65 20 6f 70 | 65 72 61 74 69 6e 67 20 |, the op|erating |
|00000860| 73 79 73 74 65 6d 20 75 | 73 65 73 20 74 68 65 20 |system u|ses the |
|00000870| 6d 65 6d 6f 72 79 20 6d | 61 6e 61 67 65 6d 65 6e |memory m|anagemen|
|00000880| 74 20 75 6e 69 74 20 28 | 4d 4d 55 29 20 74 6f 20 |t unit (|MMU) to |
|00000890| 6d 61 70 20 61 6c 6c 20 | 74 68 65 20 70 68 79 73 |map all |the phys|
|000008a0| 69 63 61 6c 20 6d 65 6d | 6f 72 79 20 28 77 68 61 |ical mem|ory (wha|
|000008b0| 74 20 74 68 65 20 68 61 | 72 64 77 61 72 65 20 73 |t the ha|rdware s|
|000008c0| 65 65 73 29 20 69 6e 74 | 6f 20 61 20 73 69 6e 67 |ees) int|o a sing|
|000008d0| 6c 65 20 63 6f 6e 74 69 | 67 75 6f 75 73 20 6c 6f |le conti|guous lo|
|000008e0| 67 69 63 61 6c 20 61 64 | 64 72 65 73 73 20 73 70 |gical ad|dress sp|
|000008f0| 61 63 65 20 28 77 68 61 | 74 20 61 6c 6c 20 4d 61 |ace (wha|t all Ma|
|00000900| 63 69 6e 74 6f 73 68 20 | 63 6f 64 65 20 73 65 65 |cintosh |code see|
|00000910| 73 29 2e 20 20 54 68 65 | 20 6c 6f 67 69 63 61 6c |s). The| logical|
|00000920| 20 61 64 64 72 65 73 73 | 20 73 70 61 63 65 20 6c | address| space l|
|00000930| 6f 6f 6b 73 20 65 78 61 | 63 74 6c 79 20 6c 69 6b |ooks exa|ctly lik|
|00000940| 65 20 74 68 65 20 6d 65 | 6d 6f 72 79 20 6d 61 70 |e the me|mory map|
|00000950| 20 79 6f 75 d5 76 65 20 | 6b 6e 6f 77 6e 20 66 6f | you.ve |known fo|
|00000960| 72 20 79 65 61 72 73 2e | 20 20 54 68 65 20 74 72 |r years.| The tr|
|00000970| 61 6e 73 6c 61 74 69 6f | 6e 20 69 73 20 63 6f 6d |anslatio|n is com|
|00000980| 70 6c 65 74 65 6c 79 20 | 74 72 61 6e 73 70 61 72 |pletely |transpar|
|00000990| 65 6e 74 20 74 6f 20 73 | 6f 66 74 77 61 72 65 2e |ent to s|oftware.|
|000009a0| 20 20 49 66 20 79 6f 75 | d5 72 65 20 61 6e 20 61 | If you|.re an a|
|000009b0| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 64 65 76 65 |pplicati|ons deve|
|000009c0| 6c 6f 70 65 72 20 61 6e | 64 20 79 6f 75 20 72 65 |loper an|d you re|
|000009d0| 61 64 20 74 68 65 20 6c | 6f 77 2d 6d 65 6d 6f 72 |ad the l|ow-memor|
|000009e0| 79 20 67 6c 6f 62 61 6c | 20 61 74 20 24 31 30 43 |y global| at $10C|
|000009f0| 2c 20 79 6f 75 20 64 6f | 6e d5 74 20 63 61 72 65 |, you do|n.t care|
|00000a00| 20 74 68 61 74 20 74 68 | 65 20 61 64 64 72 65 73 | that th|e addres|
|00000a10| 73 20 74 68 61 74 20 74 | 68 65 20 70 72 6f 63 65 |s that t|he proce|
|00000a20| 73 73 6f 72 20 61 63 74 | 75 61 6c 6c 79 20 6c 6f |ssor act|ually lo|
|00000a30| 6f 6b 73 20 61 74 20 69 | 73 20 24 30 34 30 30 30 |oks at i|s $04000|
|00000a40| 31 30 43 2e 20 20 57 68 | 65 6e 20 74 68 65 20 70 |10C. Wh|en the p|
|00000a50| 72 6f 63 65 73 73 6f 72 | 20 6f 72 69 67 69 6e 61 |rocessor| origina|
|00000a60| 6c 6c 79 20 70 75 74 20 | 61 20 76 61 6c 75 65 20 |lly put |a value |
|00000a70| 69 6e 20 74 68 61 74 20 | 73 70 6f 74 2c 20 69 74 |in that |spot, it|
|00000a80| 20 77 65 6e 74 20 74 68 | 72 6f 75 67 68 20 74 68 | went th|rough th|
|00000a90| 65 20 73 61 6d 65 20 74 | 72 61 6e 73 6c 61 74 69 |e same t|ranslati|
|00000aa0| 6f 6e 2e 20 20 45 76 65 | 72 79 74 68 69 6e 67 20 |on. Eve|rything |
|00000ab0| 69 73 20 72 65 6c 61 74 | 69 76 65 20 61 6e 64 20 |is relat|ive and |
|00000ac0| 79 6f 75 20 61 6c 77 61 | 79 73 20 67 65 74 20 6a |you alwa|ys get j|
|00000ad0| 75 73 74 20 77 68 61 74 | 20 79 6f 75 d5 64 20 65 |ust what| you.d e|
|00000ae0| 78 70 65 63 74 2e 0d 54 | 68 65 20 73 6f 6c 65 20 |xpect..T|he sole |
|00000af0| 65 78 63 65 70 74 69 6f | 6e 20 69 73 20 66 6f 72 |exceptio|n is for|
|00000b00| 20 73 6f 66 74 77 61 72 | 65 20 77 68 69 63 68 20 | softwar|e which |
|00000b10| 72 75 6e 73 20 6f 6e 20 | 74 68 65 20 4d 61 63 69 |runs on |the Maci|
|00000b20| 6e 74 6f 73 68 20 62 75 | 74 20 63 6f 6d 6d 75 6e |ntosh bu|t commun|
|00000b30| 69 63 61 74 65 73 20 61 | 64 64 72 65 73 73 65 73 |icates a|ddresses|
|00000b40| 20 74 6f 20 4e 75 42 75 | 73 20 6d 61 73 74 65 72 | to NuBu|s master|
|00000b50| 20 68 61 72 64 77 61 72 | 65 2e 20 20 53 61 79 2c | hardwar|e. Say,|
|00000b60| 20 66 6f 72 20 69 6e 73 | 74 61 6e 63 65 2c 20 74 | for ins|tance, t|
|00000b70| 68 61 74 20 79 6f 75 20 | 68 61 76 65 20 64 65 76 |hat you |have dev|
|00000b80| 65 6c 6f 70 65 64 20 61 | 20 76 69 64 65 6f 20 66 |eloped a| video f|
|00000b90| 72 61 6d 65 20 67 72 61 | 62 62 65 72 20 77 68 69 |rame gra|bber whi|
|00000ba0| 63 68 20 64 75 6d 70 73 | 20 61 6e 20 69 6d 61 67 |ch dumps| an imag|
|00000bb0| 65 20 69 6e 74 6f 20 61 | 20 68 61 6e 64 6c 65 20 |e into a| handle |
|00000bc0| 79 6f 75 d5 76 65 20 61 | 6c 6c 6f 63 61 74 65 64 |you.ve a|llocated|
|00000bd0| 20 66 6f 72 20 74 68 61 | 74 20 70 75 72 70 6f 73 | for tha|t purpos|
|00000be0| 65 2e 20 20 57 68 65 6e | 20 79 6f 75 20 63 61 6c |e. When| you cal|
|00000bf0| 6c 20 5f 4e 65 77 48 61 | 6e 64 6c 65 20 77 69 74 |l _NewHa|ndle wit|
|00000c00| 68 20 61 6e 20 61 72 67 | 75 6d 65 6e 74 20 6f 66 |h an arg|ument of|
|00000c10| 20 66 72 61 6d 65 53 69 | 7a 65 2c 20 79 6f 75 20 | frameSi|ze, you |
|00000c20| 67 65 74 20 62 61 63 6b | 20 61 20 6c 6f 67 69 63 |get back| a logic|
|00000c30| 61 6c 20 61 64 64 72 65 | 73 73 2e 20 20 49 66 20 |al addre|ss. If |
|00000c40| 79 6f 75 20 75 73 65 20 | 61 20 36 38 30 33 30 2c |you use |a 68030,|
|00000c50| 20 6f 72 20 61 20 36 38 | 30 32 30 20 77 69 74 68 | or a 68|020 with|
|00000c60| 20 61 20 36 38 38 35 31 | 20 50 4d 4d 55 2c 20 74 | a 68851| PMMU, t|
|00000c70| 6f 20 73 74 6f 72 65 20 | 64 61 74 61 20 69 6e 74 |o store |data int|
|00000c80| 6f 20 74 68 61 74 20 68 | 61 6e 64 6c 65 2c 20 74 |o that h|andle, t|
|00000c90| 68 65 20 4d 4d 55 20 70 | 65 72 66 6f 72 6d 73 20 |he MMU p|erforms |
|00000ca0| 61 6e 20 61 64 64 72 65 | 73 73 20 74 72 61 6e 73 |an addre|ss trans|
|00000cb0| 6c 61 74 69 6f 6e 20 61 | 6e 64 20 70 6c 61 63 65 |lation a|nd place|
|00000cc0| 73 20 64 61 74 61 20 69 | 6e 74 6f 20 61 20 63 6f |s data i|nto a co|
|00000cd0| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 70 68 79 73 |rrespond|ing phys|
|00000ce0| 69 63 61 6c 20 61 64 64 | 72 65 73 73 2e 20 20 4e |ical add|ress. N|
|00000cf0| 75 42 75 73 20 68 61 72 | 64 77 61 72 65 2c 20 68 |uBus har|dware, h|
|00000d00| 6f 77 65 76 65 72 2c 20 | 64 6f 65 73 20 6e 6f 74 |owever, |does not|
|00000d10| 20 75 73 65 20 74 68 65 | 20 4d 4d 55 d5 73 20 61 | use the| MMU.s a|
|00000d20| 64 64 72 65 73 73 20 6d | 61 70 70 69 6e 67 20 74 |ddress m|apping t|
|00000d30| 61 62 6c 65 73 2e 20 20 | 49 66 20 79 6f 75 72 20 |ables. |If your |
|00000d40| 64 72 69 76 65 72 20 70 | 61 73 73 65 73 20 61 6c |driver p|asses al|
|00000d50| 6f 6e 67 20 61 20 6c 6f | 67 69 63 61 6c 20 61 64 |ong a lo|gical ad|
|00000d60| 64 72 65 73 73 20 66 72 | 6f 6d 20 74 68 65 20 4d |dress fr|om the M|
|00000d70| 65 6d 6f 72 79 20 4d 61 | 6e 61 67 65 72 2c 20 74 |emory Ma|nager, t|
|00000d80| 68 65 20 66 72 61 6d 65 | 20 67 72 61 62 62 65 72 |he frame| grabber|
|00000d90| 20 64 6f 65 73 20 6e 6f | 74 20 6b 6e 6f 77 20 74 | does no|t know t|
|00000da0| 6f 20 74 72 61 6e 73 6c | 61 74 65 20 69 74 20 28 |o transl|ate it (|
|00000db0| 69 6e 64 65 65 64 20 69 | 74 20 63 61 6e 6e 6f 74 |indeed i|t cannot|
|00000dc0| 29 2c 20 61 6e 64 20 74 | 68 65 20 6c 6f 67 69 63 |), and t|he logic|
|00000dd0| 61 6c 20 61 64 64 72 65 | 73 73 20 69 73 20 69 6e |al addre|ss is in|
|00000de0| 74 65 72 70 72 65 74 65 | 64 20 61 73 20 61 20 70 |terprete|d as a p|
|00000df0| 68 79 73 69 63 61 6c 20 | 61 64 64 72 65 73 73 2e |hysical |address.|
|00000e00| 20 20 45 78 74 65 72 6e | 61 6c 20 68 61 72 64 77 | Extern|al hardw|
|00000e10| 61 72 65 20 6d 61 79 20 | 64 75 6d 70 20 61 20 62 |are may |dump a b|
|00000e20| 65 61 75 74 69 66 75 6c | 20 63 61 70 74 75 72 65 |eautiful| capture|
|00000e30| 64 20 69 6d 61 67 65 20 | 77 65 6c 6c 20 6f 75 74 |d image |well out|
|00000e40| 73 69 64 65 20 79 6f 75 | 72 20 63 61 72 65 66 75 |side you|r carefu|
|00000e50| 6c 6c 79 20 61 6c 6c 6f | 63 61 74 65 64 20 68 61 |lly allo|cated ha|
|00000e60| 6e 64 6c 65 20 61 6e 64 | 20 70 65 72 68 61 70 73 |ndle and| perhaps|
|00000e70| 20 72 69 67 68 74 20 61 | 63 72 6f 73 73 20 74 68 | right a|cross th|
|00000e80| 65 20 74 6f 70 20 6f 66 | 20 4d 61 63 73 42 75 67 |e top of| MacsBug|
|00000e90| 20 61 6e 64 20 6f 74 68 | 65 72 20 73 69 6d 69 6c | and oth|er simil|
|00000ea0| 61 72 6c 79 20 69 6d 70 | 6f 72 74 61 6e 74 20 74 |arly imp|ortant t|
|00000eb0| 68 69 6e 67 73 2e 20 20 | 42 75 67 73 20 6c 69 6b |hings. |Bugs lik|
|00000ec0| 65 20 74 68 69 73 20 61 | 72 65 20 65 78 74 72 65 |e this a|re extre|
|00000ed0| 6d 65 6c 79 20 64 69 66 | 66 69 63 75 6c 74 20 74 |mely dif|ficult t|
|00000ee0| 6f 20 69 73 6f 6c 61 74 | 65 20 75 6e 6c 65 73 73 |o isolat|e unless|
|00000ef0| 20 79 6f 75 20 75 6e 64 | 65 72 73 74 61 6e 64 20 | you und|erstand |
|00000f00| 74 68 65 69 72 20 62 65 | 68 61 76 69 6f 72 20 61 |their be|havior a|
|00000f10| 6e 64 20 61 6e 74 69 63 | 69 70 61 74 65 20 74 68 |nd antic|ipate th|
|00000f20| 65 6d 2e 0d 54 68 65 20 | 70 6f 69 6e 74 20 69 73 |em..The |point is|
|00000f30| 2c 20 6e 6f 77 20 79 6f | 75 20 6d 75 73 74 20 62 |, now yo|u must b|
|00000f40| 65 20 73 75 72 65 20 74 | 6f 20 61 6c 77 61 79 73 |e sure t|o always|
|00000f50| 20 63 6f 6e 76 65 72 74 | 20 6c 6f 67 69 63 61 6c | convert| logical|
|00000f60| 20 61 64 64 72 65 73 73 | 65 73 20 74 6f 20 63 6f | address|es to co|
|00000f70| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 70 68 79 73 |rrespond|ing phys|
|00000f80| 69 63 61 6c 20 61 64 64 | 72 65 73 73 65 73 20 62 |ical add|resses b|
|00000f90| 65 66 6f 72 65 20 70 61 | 73 73 69 6e 67 20 74 68 |efore pa|ssing th|
|00000fa0| 65 6d 20 74 6f 20 61 6e | 79 20 61 6c 74 65 72 6e |em to an|y altern|
|00000fb0| 61 74 65 20 62 75 73 20 | 6d 61 73 74 65 72 2e 20 |ate bus |master. |
|00000fc0| 20 41 20 6e 65 77 20 66 | 75 6e 63 74 69 6f 6e 20 | A new f|unction |
|00000fd0| 74 6f 20 73 75 70 70 6f | 72 74 20 74 68 69 73 20 |to suppo|rt this |
|00000fe0| 69 73 20 47 65 74 50 68 | 79 73 69 63 61 6c 2c 20 |is GetPh|ysical, |
|00000ff0| 77 68 69 63 68 20 69 73 | 20 64 6f 63 75 6d 65 6e |which is| documen|
|00001000| 74 65 64 20 69 6e 20 49 | 6e 73 69 64 65 20 4d 61 |ted in I|nside Ma|
|00001010| 63 69 6e 74 6f 73 68 2c | 20 56 6f 6c 75 6d 65 20 |cintosh,| Volume |
|00001020| 56 49 2e 20 20 d2 47 72 | 65 61 74 2c d3 20 79 6f |VI. .Gr|eat,. yo|
|00001030| 75 20 73 61 79 2c 20 6f | 6e 63 65 20 79 6f 75 d5 |u say, o|nce you.|
|00001040| 76 65 20 72 65 61 64 20 | 74 68 65 20 64 6f 63 75 |ve read |the docu|
|00001050| 6d 65 6e 74 61 74 69 6f | 6e 2e 20 20 d2 42 75 74 |mentatio|n. .But|
|00001060| 20 47 65 74 50 68 79 73 | 69 63 61 6c 20 69 73 20 | GetPhys|ical is |
|00001070| 61 20 53 79 73 74 65 6d | 20 53 6f 66 74 77 61 72 |a System| Softwar|
|00001080| 65 20 37 2e 30 20 66 65 | 61 74 75 72 65 20 61 6e |e 7.0 fe|ature an|
|00001090| 64 20 61 20 56 69 72 74 | 75 61 6c 20 4d 65 6d 6f |d a Virt|ual Memo|
|000010a0| 72 79 20 66 65 61 74 75 | 72 65 20 74 6f 20 62 6f |ry featu|re to bo|
|000010b0| 6f 74 2e 20 20 57 68 61 | 74 20 64 6f 20 49 20 64 |ot. Wha|t do I d|
|000010c0| 6f 20 66 6f 72 20 53 79 | 73 74 65 6d 20 36 2e 30 |o for Sy|stem 6.0|
|000010d0| 2e 78 20 6f 72 20 69 66 | 20 49 d5 6d 20 6e 6f 74 |.x or if| I.m not|
|000010e0| 20 72 75 6e 6e 69 6e 67 | 20 56 4d 3f d3 0d 49 d5 | running| VM?..I.|
|000010f0| 6d 20 67 6c 61 64 20 79 | 6f 75 20 61 73 6b 65 64 |m glad y|ou asked|
|00001100| 2c 20 62 65 63 61 75 73 | 65 20 56 4d 20 61 6e 64 |, becaus|e VM and|
|00001110| 20 74 68 65 20 6d 65 6d | 6f 72 79 20 61 72 63 68 | the mem|ory arch|
|00001120| 69 74 65 63 74 75 72 65 | 20 6f 66 20 74 68 65 20 |itecture| of the |
|00001130| 4d 61 63 69 6e 74 6f 73 | 68 20 49 49 63 69 20 61 |Macintos|h IIci a|
|00001140| 72 65 20 72 65 6c 61 74 | 65 64 20 74 6f 70 69 63 |re relat|ed topic|
|00001150| 73 2e 20 20 47 65 74 50 | 68 79 73 69 63 61 6c 2c |s. GetP|hysical,|
|00001160| 20 61 20 72 6f 75 74 69 | 6e 65 20 72 65 71 75 69 | a routi|ne requi|
|00001170| 72 65 64 20 62 79 20 74 | 68 65 20 49 49 63 69 2c |red by t|he IIci,|
|00001180| 20 69 73 20 6f 6e 65 20 | 6f 66 20 61 20 73 75 69 | is one |of a sui|
|00001190| 74 65 20 6f 66 20 66 75 | 6e 63 74 69 6f 6e 73 20 |te of fu|nctions |
|000011a0| 64 69 73 70 61 74 63 68 | 65 64 20 62 79 20 61 20 |dispatch|ed by a |
|000011b0| 74 72 61 70 20 63 61 6c | 6c 65 64 20 5f 4d 65 6d |trap cal|led _Mem|
|000011c0| 6f 72 79 44 69 73 70 61 | 74 63 68 20 28 24 41 30 |oryDispa|tch ($A0|
|000011d0| 35 43 29 2c 20 77 68 69 | 63 68 20 69 73 20 74 68 |5C), whi|ch is th|
|000011e0| 65 20 73 61 6d 65 20 74 | 72 61 70 20 75 73 65 64 |e same t|rap used|
|000011f0| 20 62 79 20 74 68 65 20 | 6d 61 6a 6f 72 20 56 4d | by the |major VM|
|00001200| 20 63 61 6c 6c 73 2e 20 | 20 42 65 63 61 75 73 65 | calls. | Because|
|00001210| 20 73 6f 6d 65 20 6d 61 | 63 68 69 6e 65 73 20 72 | some ma|chines r|
|00001220| 65 71 75 69 72 65 20 47 | 65 74 50 68 79 73 69 63 |equire G|etPhysic|
|00001230| 61 6c 20 65 76 65 6e 20 | 77 69 74 68 6f 75 74 20 |al even |without |
|00001240| 56 4d 2c 20 74 68 6f 73 | 65 20 6d 61 63 68 69 6e |VM, thos|e machin|
|00001250| 65 73 20 68 61 76 65 20 | 61 20 6c 69 6d 69 74 65 |es have |a limite|
|00001260| 64 20 66 6f 72 6d 20 6f | 66 20 5f 4d 65 6d 6f 72 |d form o|f _Memor|
|00001270| 79 44 69 73 70 61 74 63 | 68 20 69 6d 70 6c 65 6d |yDispatc|h implem|
|00001280| 65 6e 74 65 64 20 69 6e | 20 52 4f 4d 2e 0d 59 6f |ented in| ROM..Yo|
|00001290| 75 20 63 61 6e 20 63 61 | 6c 6c 20 47 65 74 50 68 |u can ca|ll GetPh|
|000012a0| 79 73 69 63 61 6c 20 75 | 6e 64 65 72 20 53 79 73 |ysical u|nder Sys|
|000012b0| 74 65 6d 20 36 2e 30 2e | 78 20 6f 72 20 75 6e 64 |tem 6.0.|x or und|
|000012c0| 65 72 20 53 79 73 74 65 | 6d 20 37 2e 30 20 65 76 |er Syste|m 7.0 ev|
|000012d0| 65 6e 20 77 68 65 6e 20 | 56 4d 20 69 73 20 6e 6f |en when |VM is no|
|000012e0| 74 20 72 75 6e 6e 69 6e | 67 d1 61 6c 6c 20 79 6f |t runnin|g.all yo|
|000012f0| 75 20 6d 75 73 74 20 64 | 6f 20 66 69 72 73 74 20 |u must d|o first |
|00001300| 69 73 20 63 68 65 63 6b | 20 74 6f 20 73 65 65 20 |is check| to see |
|00001310| 74 68 61 74 20 74 68 65 | 20 5f 4d 65 6d 6f 72 79 |that the| _Memory|
|00001320| 44 69 73 70 61 74 63 68 | 20 74 72 61 70 20 69 73 |Dispatch| trap is|
|00001330| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 2e 20 20 49 | impleme|nted. I|
|00001340| 66 20 74 68 69 73 20 74 | 72 61 70 20 69 73 20 69 |f this t|rap is i|
|00001350| 6d 70 6c 65 6d 65 6e 74 | 65 64 2c 20 69 74 20 69 |mplement|ed, it i|
|00001360| 73 20 74 68 65 72 65 20 | 66 6f 72 20 61 20 72 65 |s there |for a re|
|00001370| 61 73 6f 6e 2c 20 61 6e | 64 20 79 6f 75 20 73 68 |ason, an|d you sh|
|00001380| 6f 75 6c 64 20 75 73 65 | 20 69 74 2e 20 20 41 6c |ould use| it. Al|
|00001390| 74 68 6f 75 67 68 20 47 | 65 74 50 68 79 73 69 63 |though G|etPhysic|
|000013a0| 61 6c 20 69 73 20 70 72 | 65 73 65 6e 74 20 6f 6e |al is pr|esent on|
|000013b0| 6c 79 20 66 6f 72 20 63 | 65 72 74 61 69 6e 20 6d |ly for c|ertain m|
|000013c0| 61 63 68 69 6e 65 73 20 | 77 69 74 68 6f 75 74 20 |achines |without |
|000013d0| 56 4d 2c 20 69 74 20 69 | 73 20 70 72 65 73 65 6e |VM, it i|s presen|
|000013e0| 74 20 61 6e 64 20 72 65 | 71 75 69 72 65 64 20 66 |t and re|quired f|
|000013f0| 6f 72 20 61 6c 6c 20 6d | 61 63 68 69 6e 65 73 20 |or all m|achines |
|00001400| 72 75 6e 6e 69 6e 67 20 | 56 4d 2e 20 20 49 66 20 |running |VM. If |
|00001410| 79 6f 75 20 75 70 64 61 | 74 65 20 79 6f 75 72 20 |you upda|te your |
|00001420| 63 6f 64 65 20 74 6f 20 | 62 65 20 63 6f 6d 70 61 |code to |be compa|
|00001430| 74 69 62 6c 65 20 77 69 | 74 68 20 74 68 65 20 49 |tible wi|th the I|
|00001440| 49 63 69 20 61 6e 64 20 | 49 49 73 69 20 69 6e 20 |Ici and |IIsi in |
|00001450| 74 68 65 20 36 2e 30 2e | 78 20 77 6f 72 6c 64 2c |the 6.0.|x world,|
|00001460| 20 79 6f 75 20 61 72 65 | 20 61 6c 72 65 61 64 79 | you are| already|
|00001470| 20 64 6f 69 6e 67 20 70 | 61 72 74 20 6f 66 20 77 | doing p|art of w|
|00001480| 68 61 74 20 69 73 20 72 | 65 71 75 69 72 65 64 20 |hat is r|equired |
|00001490| 74 6f 20 62 65 20 63 6f | 6d 70 61 74 69 62 6c 65 |to be co|mpatible|
|000014a0| 20 77 69 74 68 20 56 69 | 72 74 75 61 6c 20 4d 65 | with Vi|rtual Me|
|000014b0| 6d 6f 72 79 20 61 6e 64 | 20 53 79 73 74 65 6d 20 |mory and| System |
|000014c0| 53 6f 66 74 77 61 72 65 | 20 37 2e 30 2e 0d 48 6f |Software| 7.0..Ho|
|000014d0| 6c 64 69 6e 67 20 61 6e | 64 20 4c 6f 63 6b 69 6e |lding an|d Lockin|
|000014e0| 67 20 4d 65 6d 6f 72 79 | 20 56 65 72 73 75 73 20 |g Memory| Versus |
|000014f0| 4c 6f 63 6b 69 6e 67 20 | 48 61 6e 64 6c 65 73 0d |Locking |Handles.|
|00001500| 56 69 72 74 75 61 6c 20 | 4d 65 6d 6f 72 79 20 69 |Virtual |Memory i|
|00001510| 6e 74 72 6f 64 75 63 65 | 73 20 74 77 6f 20 6e 65 |ntroduce|s two ne|
|00001520| 77 20 63 6f 6e 63 65 70 | 74 73 d1 68 6f 6c 64 69 |w concep|ts.holdi|
|00001530| 6e 67 20 61 6e 64 20 6c | 6f 63 6b 69 6e 67 20 61 |ng and l|ocking a|
|00001540| 20 72 61 6e 67 65 20 6f | 66 20 76 69 72 74 75 61 | range o|f virtua|
|00001550| 6c 20 6d 65 6d 6f 72 79 | 2e 20 20 54 68 65 73 65 |l memory|. These|
|00001560| 20 61 72 65 20 6e 6f 74 | 20 74 6f 20 62 65 20 63 | are not| to be c|
|00001570| 6f 6e 66 75 73 65 64 20 | 77 69 74 68 20 6c 6f 63 |onfused |with loc|
|00001580| 6b 69 6e 67 20 61 20 68 | 61 6e 64 6c 65 2e 20 20 |king a h|andle. |
|00001590| 4c 6f 63 6b 69 6e 67 20 | 61 20 68 61 6e 64 6c 65 |Locking |a handle|
|000015a0| 20 70 72 65 76 65 6e 74 | 73 20 74 68 65 20 68 61 | prevent|s the ha|
|000015b0| 6e 64 6c 65 20 66 72 6f | 6d 20 63 68 61 6e 67 69 |ndle fro|m changi|
|000015c0| 6e 67 20 69 74 73 20 6c | 6f 67 69 63 61 6c 20 61 |ng its l|ogical a|
|000015d0| 64 64 72 65 73 73 20 64 | 75 72 69 6e 67 20 4d 65 |ddress d|uring Me|
|000015e0| 6d 6f 72 79 20 4d 61 6e | 61 67 65 72 20 6f 70 65 |mory Man|ager ope|
|000015f0| 72 61 74 69 6f 6e 73 2e | 20 48 6f 6c 64 69 6e 67 |rations.| Holding|
|00001600| 20 61 6e 64 20 6c 6f 63 | 6b 69 6e 67 20 76 69 72 | and loc|king vir|
|00001610| 74 75 61 6c 20 6d 65 6d | 6f 72 79 20 61 66 66 65 |tual mem|ory affe|
|00001620| 63 74 73 20 68 6f 77 20 | 56 4d 20 64 65 61 6c 73 |cts how |VM deals|
|00001630| 20 77 69 74 68 20 61 72 | 62 69 74 72 61 72 79 20 | with ar|bitrary |
|00001640| 72 61 6e 67 65 73 20 6f | 66 20 6d 65 6d 6f 72 79 |ranges o|f memory|
|00001650| 20 64 75 72 69 6e 67 20 | 70 61 67 69 6e 67 20 6f | during |paging o|
|00001660| 70 65 72 61 74 69 6f 6e | 73 2e 0d 48 6f 6c 64 69 |peration|s..Holdi|
|00001670| 6e 67 20 61 6e 64 20 6c | 6f 63 6b 69 6e 67 20 6d |ng and l|ocking m|
|00001680| 65 6d 6f 72 79 20 28 61 | 73 20 6f 70 70 6f 73 65 |emory (a|s oppose|
|00001690| 64 20 74 6f 20 61 20 68 | 61 6e 64 6c 65 29 20 61 |d to a h|andle) a|
|000016a0| 72 65 20 56 4d 20 66 75 | 6e 63 74 69 6f 6e 73 20 |re VM fu|nctions |
|000016b0| 65 78 63 6c 75 73 69 76 | 65 6c 79 20 61 6e 64 20 |exclusiv|ely and |
|000016c0| 61 72 65 20 61 63 63 6f | 6d 70 6c 69 73 68 65 64 |are acco|mplished|
|000016d0| 20 77 69 74 68 20 66 6f | 75 72 20 6e 65 77 20 5f | with fo|ur new _|
|000016e0| 4d 65 6d 6f 72 79 44 69 | 73 70 61 74 63 68 20 72 |MemoryDi|spatch r|
|000016f0| 6f 75 74 69 6e 65 73 3a | 20 20 48 6f 6c 64 4d 65 |outines:| HoldMe|
|00001700| 6d 6f 72 79 20 61 6e 64 | 20 4c 6f 63 6b 4d 65 6d |mory and| LockMem|
|00001710| 6f 72 79 2c 20 61 6e 64 | 20 74 68 65 20 63 6f 72 |ory, and| the cor|
|00001720| 72 65 73 70 6f 6e 64 69 | 6e 67 20 72 6f 75 74 69 |respondi|ng routi|
|00001730| 6e 65 73 20 74 6f 20 75 | 6e 64 6f 20 74 68 65 73 |nes to u|ndo thes|
|00001740| 65 20 6f 70 65 72 61 74 | 69 6f 6e 73 2c 20 55 6e |e operat|ions, Un|
|00001750| 68 6f 6c 64 4d 65 6d 6f | 72 79 20 61 6e 64 20 55 |holdMemo|ry and U|
|00001760| 6e 6c 6f 63 6b 4d 65 6d | 6f 72 79 2e 20 20 50 61 |nlockMem|ory. Pa|
|00001770| 79 20 73 70 65 63 69 61 | 6c 20 61 74 74 65 6e 74 |y specia|l attent|
|00001780| 69 6f 6e 20 61 6e 79 20 | 74 69 6d 65 20 79 6f 75 |ion any |time you|
|00001790| 20 68 6f 6c 64 20 6f 72 | 20 6c 6f 63 6b 20 61 20 | hold or| lock a |
|000017a0| 72 61 6e 67 65 20 6f 66 | 20 6d 65 6d 6f 72 79 20 |range of| memory |
|000017b0| 74 68 61 74 20 79 6f 75 | 20 73 75 62 73 65 71 75 |that you| subsequ|
|000017c0| 65 6e 74 6c 79 20 75 6e | 68 6f 6c 64 20 6f 72 20 |ently un|hold or |
|000017d0| 75 6e 6c 6f 63 6b 20 74 | 68 65 20 73 61 6d 65 20 |unlock t|he same |
|000017e0| 72 61 6e 67 65 2e 20 20 | 45 76 65 72 79 20 73 69 |range. |Every si|
|000017f0| 6e 67 6c 65 20 63 61 6c | 6c 20 74 6f 20 48 6f 6c |ngle cal|l to Hol|
|00001800| 64 4d 65 6d 6f 72 79 20 | 6f 72 20 4c 6f 63 6b 4d |dMemory |or LockM|
|00001810| 65 6d 6f 72 79 20 6d 75 | 73 74 20 62 65 20 62 61 |emory mu|st be ba|
|00001820| 6c 61 6e 63 65 64 20 62 | 79 20 61 20 63 6f 72 72 |lanced b|y a corr|
|00001830| 65 73 70 6f 6e 64 69 6e | 67 20 55 6e 68 6f 6c 64 |espondin|g Unhold|
|00001840| 4d 65 6d 6f 72 79 20 6f | 72 20 55 6e 6c 6f 63 6b |Memory o|r Unlock|
|00001850| 4d 65 6d 6f 72 79 20 62 | 65 63 61 75 73 65 20 74 |Memory b|ecause t|
|00001860| 68 65 20 6f 70 65 72 61 | 74 69 6e 67 20 73 79 73 |he opera|ting sys|
|00001870| 74 65 6d 20 73 75 70 70 | 6f 72 74 73 20 6d 75 6c |tem supp|orts mul|
|00001880| 74 69 70 6c 65 20 6c 65 | 76 65 6c 73 20 6f 66 20 |tiple le|vels of |
|00001890| 6c 6f 63 6b 69 6e 67 20 | 61 6e 64 20 68 6f 6c 64 |locking |and hold|
|000018a0| 69 6e 67 2c 20 6d 75 63 | 68 20 6c 69 6b 65 20 69 |ing, muc|h like i|
|000018b0| 74 20 73 75 70 70 6f 72 | 74 73 20 6d 75 6c 74 69 |t suppor|ts multi|
|000018c0| 70 6c 65 20 6c 65 76 65 | 6c 73 20 6f 66 20 63 75 |ple leve|ls of cu|
|000018d0| 72 73 6f 72 20 6f 62 73 | 63 75 72 61 74 69 6f 6e |rsor obs|curation|
|000018e0| 20 77 69 74 68 20 5f 53 | 68 6f 77 43 75 72 73 6f | with _S|howCurso|
|000018f0| 72 20 61 6e 64 20 5f 48 | 69 64 65 43 75 72 73 6f |r and _H|ideCurso|
|00001900| 72 2e 0d 48 6f 6c 64 69 | 6e 67 20 61 20 72 61 6e |r..Holdi|ng a ran|
|00001910| 67 65 20 6f 66 20 6d 65 | 6d 6f 72 79 20 67 75 61 |ge of me|mory gua|
|00001920| 72 61 6e 74 65 65 73 20 | 74 68 61 74 20 74 68 65 |rantees |that the|
|00001930| 20 64 61 74 61 20 69 6e | 20 74 68 61 74 20 72 61 | data in| that ra|
|00001940| 6e 67 65 20 69 73 20 61 | 63 74 75 61 6c 6c 79 20 |nge is a|ctually |
|00001950| 73 6f 6d 65 77 68 65 72 | 65 20 69 6e 20 70 68 79 |somewher|e in phy|
|00001960| 73 69 63 61 6c 20 4d 61 | 63 69 6e 74 6f 73 68 20 |sical Ma|cintosh |
|00001970| 52 41 4d 20 61 6e 64 20 | 74 68 61 74 20 6e 6f 20 |RAM and |that no |
|00001980| 70 61 67 69 6e 67 20 61 | 63 74 69 76 69 74 79 20 |paging a|ctivity |
|00001990| 69 73 20 6e 65 63 65 73 | 73 61 72 79 20 74 6f 20 |is neces|sary to |
|000019a0| 6c 6f 61 64 20 69 74 2e | 20 20 54 68 69 73 20 69 |load it.| This i|
|000019b0| 73 20 63 72 69 74 69 63 | 61 6c 20 66 6f 72 20 74 |s critic|al for t|
|000019c0| 61 73 6b 73 20 77 68 69 | 63 68 20 72 75 6e 20 61 |asks whi|ch run a|
|000019d0| 74 20 69 6e 74 65 72 72 | 75 70 74 20 74 69 6d 65 |t interr|upt time|
|000019e0| 2c 20 73 69 6e 63 65 20 | 70 61 67 69 6e 67 20 61 |, since |paging a|
|000019f0| 63 74 69 76 69 74 79 20 | 73 68 6f 75 6c 64 20 6e |ctivity |should n|
|00001a00| 6f 74 20 62 65 20 69 6e | 69 74 69 61 74 65 64 20 |ot be in|itiated |
|00001a10| 61 74 20 69 6e 74 65 72 | 72 75 70 74 20 74 69 6d |at inter|rupt tim|
|00001a20| 65 2e 20 20 56 4d 20 69 | 73 20 6e 6f 74 20 67 75 |e. VM i|s not gu|
|00001a30| 61 72 61 6e 74 65 65 64 | 20 74 6f 20 62 65 20 72 |aranteed| to be r|
|00001a40| 65 65 6e 74 72 61 6e 74 | 2c 20 61 6e 64 20 62 65 |eentrant|, and be|
|00001a50| 63 61 75 73 65 20 69 6e | 74 65 72 72 75 70 74 73 |cause in|terrupts|
|00001a60| 20 6d 61 79 20 6f 63 63 | 75 72 20 69 6e 20 74 68 | may occ|ur in th|
|00001a70| 65 20 6d 69 64 64 6c 65 | 20 6f 66 20 70 61 67 69 |e middle| of pagi|
|00001a80| 6e 67 2c 20 61 6e 79 20 | 64 61 74 61 20 61 63 63 |ng, any |data acc|
|00001a90| 65 73 73 65 64 20 62 79 | 20 61 6e 20 69 6e 74 65 |essed by| an inte|
|00001aa0| 72 72 75 70 74 20 68 61 | 6e 64 6c 65 72 20 73 68 |rrupt ha|ndler sh|
|00001ab0| 6f 75 6c 64 20 72 65 73 | 69 64 65 20 69 6e 20 61 |ould res|ide in a|
|00001ac0| 20 68 65 6c 64 20 62 6c | 6f 63 6b 20 6f 66 20 6d | held bl|ock of m|
|00001ad0| 65 6d 6f 72 79 2e 20 4f | 6e 6c 79 20 68 6f 6c 64 |emory. O|nly hold|
|00001ae0| 20 6d 65 6d 6f 72 79 20 | 77 68 69 63 68 20 6c 65 | memory |which le|
|00001af0| 67 69 74 69 6d 61 74 65 | 6c 79 20 6e 65 65 64 73 |gitimate|ly needs|
|00001b00| 20 74 6f 20 62 65 20 68 | 65 6c 64 20 74 68 6f 75 | to be h|eld thou|
|00001b10| 67 68 2c 20 62 65 63 61 | 75 73 65 20 61 6e 79 20 |gh, beca|use any |
|00001b20| 6d 65 6d 6f 72 79 20 77 | 68 69 63 68 20 69 73 20 |memory w|hich is |
|00001b30| 68 65 6c 64 20 62 65 63 | 6f 6d 65 73 20 69 6e 65 |held bec|omes ine|
|00001b40| 6c 69 67 69 62 6c 65 20 | 66 6f 72 20 70 61 67 69 |ligible |for pagi|
|00001b50| 6e 67 2e 20 20 54 68 69 | 73 20 72 65 64 75 63 65 |ng. Thi|s reduce|
|00001b60| 73 20 74 68 65 20 73 70 | 61 63 65 20 56 4d 20 68 |s the sp|ace VM h|
|00001b70| 61 73 20 74 6f 20 77 6f | 72 6b 20 77 69 74 68 20 |as to wo|rk with |
|00001b80| 61 6e 64 20 6d 61 79 20 | 73 69 67 6e 69 66 69 63 |and may |signific|
|00001b90| 61 6e 74 6c 79 20 69 6d | 70 61 63 74 20 73 79 73 |antly im|pact sys|
|00001ba0| 74 65 6d 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 2e |tem perf|ormance.|
|00001bb0| 20 20 53 6f 6d 65 20 69 | 6e 74 65 72 72 75 70 74 | Some i|nterrupt|
|00001bc0| 2d 74 69 6d 65 20 74 61 | 73 6b 73 20 61 72 65 20 |-time ta|sks are |
|00001bd0| 64 65 66 65 72 72 65 64 | 20 62 79 20 56 4d 20 75 |deferred| by VM u|
|00001be0| 6e 74 69 6c 20 70 61 67 | 69 6e 67 20 69 73 20 73 |ntil pag|ing is s|
|00001bf0| 61 66 65 2c 20 73 6f 20 | 6d 65 6d 6f 72 79 20 74 |afe, so |memory t|
|00001c00| 68 65 79 20 74 6f 75 63 | 68 20 64 6f 65 73 20 6e |hey touc|h does n|
|00001c10| 6f 74 20 61 6c 77 61 79 | 73 20 68 61 76 65 20 74 |ot alway|s have t|
|00001c20| 6f 20 62 65 20 68 65 6c | 64 2e 20 20 54 68 65 73 |o be hel|d. Thes|
|00001c30| 65 20 74 61 73 6b 73 20 | 61 72 65 20 63 61 6c 6c |e tasks |are call|
|00001c40| 65 64 20 6f 75 74 20 62 | 65 6c 6f 77 2c 20 69 6e |ed out b|elow, in|
|00001c50| 20 74 68 65 20 73 65 63 | 74 69 6f 6e 20 d2 43 6f | the sec|tion .Co|
|00001c60| 6d 70 61 74 69 62 69 6c | 69 74 79 20 57 69 74 68 |mpatibil|ity With|
|00001c70| 20 4f 74 68 65 72 20 44 | 65 76 69 63 65 20 44 72 | Other D|evice Dr|
|00001c80| 69 76 65 72 73 20 61 6e | 64 20 49 6e 74 65 72 72 |ivers an|d Interr|
|00001c90| 75 70 74 2d 4c 65 76 65 | 6c 20 43 6f 64 65 2e d3 |upt-Leve|l Code..|
|00001ca0| 0d 4c 6f 63 6b 69 6e 67 | 20 61 20 72 61 6e 67 65 |.Locking| a range|
|00001cb0| 20 6f 66 20 6d 65 6d 6f | 72 79 20 69 73 20 6d 6f | of memo|ry is mo|
|00001cc0| 72 65 20 73 65 76 65 72 | 65 20 74 68 61 6e 20 68 |re sever|e than h|
|00001cd0| 6f 6c 64 69 6e 67 20 69 | 74 2e 20 20 54 68 69 73 |olding i|t. This|
|00001ce0| 20 6e 6f 74 20 6f 6e 6c | 79 20 66 6f 72 63 65 73 | not onl|y forces|
|00001cf0| 20 74 68 65 20 72 61 6e | 67 65 20 74 6f 20 62 65 | the ran|ge to be|
|00001d00| 20 68 65 6c 64 20 72 65 | 73 69 64 65 6e 74 20 69 | held re|sident i|
|00001d10| 6e 20 70 68 79 73 69 63 | 61 6c 20 52 41 4d 2c 20 |n physic|al RAM, |
|00001d20| 62 75 74 20 61 6c 73 6f | 20 70 72 65 76 65 6e 74 |but also| prevent|
|00001d30| 73 20 69 74 73 20 6c 6f | 67 69 63 61 6c 20 61 64 |s its lo|gical ad|
|00001d40| 64 72 65 73 73 20 66 72 | 6f 6d 20 6d 6f 76 69 6e |dress fr|om movin|
|00001d50| 67 20 77 69 74 68 20 72 | 65 73 70 65 63 74 20 74 |g with r|espect t|
|00001d60| 6f 20 69 74 73 20 70 68 | 79 73 69 63 61 6c 20 61 |o its ph|ysical a|
|00001d70| 64 64 72 65 73 73 2e 20 | 20 54 68 69 73 20 69 73 |ddress. | This is|
|00001d80| 20 69 6d 70 6f 72 74 61 | 6e 74 20 66 6f 72 20 64 | importa|nt for d|
|00001d90| 72 69 76 65 72 73 20 77 | 68 69 63 68 20 69 6e 69 |rivers w|hich ini|
|00001da0| 74 69 61 74 65 20 44 4d | 41 20 74 72 61 6e 73 61 |tiate DM|A transa|
|00001db0| 63 74 69 6f 6e 73 2c 20 | 62 65 63 61 75 73 65 20 |ctions, |because |
|00001dc0| 74 68 65 72 65 20 6d 75 | 73 74 20 62 65 20 61 20 |there mu|st be a |
|00001dd0| 6b 6e 6f 77 6e 2c 20 73 | 74 61 74 69 63 20 72 65 |known, s|tatic re|
|00001de0| 6c 61 74 69 6f 6e 73 68 | 69 70 20 62 65 74 77 65 |lationsh|ip betwe|
|00001df0| 65 6e 20 6c 6f 67 69 63 | 61 6c 20 61 6e 64 20 70 |en logic|al and p|
|00001e00| 68 79 73 69 63 61 6c 20 | 61 64 64 72 65 73 73 65 |hysical |addresse|
|00001e10| 73 20 66 6f 72 20 74 68 | 65 20 64 75 72 61 74 69 |s for th|e durati|
|00001e20| 6f 6e 20 6f 66 20 73 75 | 63 68 20 61 6e 20 6f 70 |on of su|ch an op|
|00001e30| 65 72 61 74 69 6f 6e 2e | 20 20 50 61 72 74 20 6f |eration.| Part o|
|00001e40| 66 20 74 68 65 20 62 65 | 68 61 76 69 6f 72 20 6f |f the be|havior o|
|00001e50| 66 20 4c 6f 63 6b 4d 65 | 6d 6f 72 79 20 69 73 20 |f LockMe|mory is |
|00001e60| 74 6f 20 6d 61 6b 65 20 | 74 68 65 20 61 73 73 6f |to make |the asso|
|00001e70| 63 69 61 74 65 64 20 6d | 65 6d 6f 72 79 20 6e 6f |ciated m|emory no|
|00001e80| 6e 2d 63 61 63 68 61 62 | 6c 65 20 77 68 69 63 68 |n-cachab|le which|
|00001e90| 20 69 73 20 69 6d 70 6f | 72 74 61 6e 74 20 66 6f | is impo|rtant fo|
|00001ea0| 72 20 44 4d 41 20 74 72 | 61 6e 73 66 65 72 73 2e |r DMA tr|ansfers.|
|00001eb0| 0d 57 61 72 6e 69 6e 67 | 3a 09 41 70 70 6c 65 20 |.Warning|:.Apple |
|00001ec0| 63 61 6e 6e 6f 74 20 6d | 61 6b 65 20 74 68 65 20 |cannot m|ake the |
|00001ed0| 70 6f 69 6e 74 20 74 6f | 6f 20 73 74 72 6f 6e 67 |point to|o strong|
|00001ee0| 6c 79 20 74 68 61 74 20 | 6d 65 6d 6f 72 79 20 73 |ly that |memory s|
|00001ef0| 68 6f 75 6c 64 20 6f 6e | 6c 79 20 62 65 20 68 65 |hould on|ly be he|
|00001f00| 6c 64 20 6f 72 20 6c 6f | 63 6b 65 64 20 77 68 65 |ld or lo|cked whe|
|00001f10| 6e 20 61 62 73 6f 6c 75 | 74 65 6c 79 20 6e 65 63 |n absolu|tely nec|
|00001f20| 65 73 73 61 72 79 2c 20 | 61 6e 64 20 6f 6e 6c 79 |essary, |and only|
|00001f30| 20 61 73 20 6c 6f 6e 67 | 20 61 73 20 6e 65 63 65 | as long| as nece|
|00001f40| 73 73 61 72 79 2e 20 20 | 49 74 20 69 73 20 77 6f |ssary. |It is wo|
|00001f50| 72 74 68 20 72 65 73 74 | 61 74 69 6e 67 20 74 68 |rth rest|ating th|
|00001f60| 61 74 20 74 68 65 20 69 | 6d 70 61 63 74 20 6f 6e |at the i|mpact on|
|00001f70| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 63 61 6e | perform|ance can|
|00001f80| 20 62 65 20 73 69 67 6e | 69 66 69 63 61 6e 74 20 | be sign|ificant |
|00001f90| 6f 72 20 65 76 65 6e 20 | 66 61 74 61 6c 20 69 6e |or even |fatal in|
|00001fa0| 20 73 65 76 65 72 65 20 | 63 61 73 65 73 2e 20 20 | severe |cases. |
|00001fb0| 49 74 20 69 73 20 61 20 | 63 72 69 6d 65 20 61 67 |It is a |crime ag|
|00001fc0| 61 69 6e 73 74 20 74 68 | 65 20 6d 61 63 68 69 6e |ainst th|e machin|
|00001fd0| 65 20 74 6f 20 68 6f 6c | 64 20 6f 72 20 6c 6f 63 |e to hol|d or loc|
|00001fe0| 6b 20 6d 65 6d 6f 72 79 | 20 75 6e 6e 65 63 65 73 |k memory| unneces|
|00001ff0| 73 61 72 69 6c 79 2e 20 | 20 46 61 69 6c 75 72 65 |sarily. | Failure|
|00002000| 20 74 6f 20 75 6e 68 6f | 6c 64 20 6f 72 20 75 6e | to unho|ld or un|
|00002010| 6c 6f 63 6b 20 6d 65 6d | 6f 72 79 20 70 72 65 76 |lock mem|ory prev|
|00002020| 69 6f 75 73 6c 79 20 68 | 65 6c 64 20 6f 72 20 6c |iously h|eld or l|
|00002030| 6f 63 6b 65 64 20 69 73 | 20 6d 6f 73 74 20 68 65 |ocked is| most he|
|00002040| 69 6e 6f 75 73 2e 0d 49 | 6e 20 6e 6f 6e 2d 56 4d |inous..I|n non-VM|
|00002050| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 73 2c 20 74 | environ|ments, t|
|00002060| 68 65 72 65 20 69 73 20 | 6e 6f 20 70 61 67 65 20 |here is |no page |
|00002070| 73 77 61 70 70 69 6e 67 | 20 61 63 74 69 76 69 74 |swapping| activit|
|00002080| 79 2e 20 20 54 68 69 73 | 20 69 73 20 73 69 6d 69 |y. This| is simi|
|00002090| 6c 61 72 20 74 6f 20 61 | 6c 6c 20 6f 66 20 6d 65 |lar to a|ll of me|
|000020a0| 6d 6f 72 79 20 62 65 69 | 6e 67 20 6c 6f 63 6b 65 |mory bei|ng locke|
|000020b0| 64 2c 20 65 78 63 65 70 | 74 20 74 68 61 74 20 63 |d, excep|t that c|
|000020c0| 61 63 68 69 6e 67 20 69 | 73 20 73 74 69 6c 6c 20 |aching i|s still |
|000020d0| 65 6e 61 62 6c 65 64 2e | 20 20 54 72 75 6c 79 20 |enabled.| Truly |
|000020e0| 6c 6f 63 6b 65 64 20 6d | 65 6d 6f 72 79 20 69 73 |locked m|emory is|
|000020f0| 20 6e 65 69 74 68 65 72 | 20 63 61 63 68 65 64 20 | neither| cached |
|00002100| 6e 6f 72 20 70 61 67 65 | 64 2e 20 20 49 66 20 79 |nor page|d. If y|
|00002110| 6f 75 20 61 72 65 20 72 | 75 6e 6e 69 6e 67 20 53 |ou are r|unning S|
|00002120| 79 73 74 65 6d 20 53 6f | 66 74 77 61 72 65 20 37 |ystem So|ftware 7|
|00002130| 2e 30 20 77 69 74 68 20 | 56 4d 2c 20 79 6f 75 20 |.0 with |VM, you |
|00002140| 6d 75 73 74 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |must exp|licitly |
|00002150| 6c 6f 63 6b 20 61 20 72 | 61 6e 67 65 20 6f 66 20 |lock a r|ange of |
|00002160| 6d 65 6d 6f 72 79 20 77 | 69 74 68 20 4c 6f 63 6b |memory w|ith Lock|
|00002170| 4d 65 6d 6f 72 79 20 62 | 65 66 6f 72 65 20 63 61 |Memory b|efore ca|
|00002180| 6c 6c 69 6e 67 20 47 65 | 74 50 68 79 73 69 63 61 |lling Ge|tPhysica|
|00002190| 6c 2e 20 20 59 6f 75 20 | 6d 61 79 20 6f 6e 6c 79 |l. You |may only|
|000021a0| 20 63 61 6c 6c 20 47 65 | 74 50 68 79 73 69 63 61 | call Ge|tPhysica|
|000021b0| 6c 20 6f 6e 20 61 20 6c | 6f 63 6b 65 64 20 62 6c |l on a l|ocked bl|
|000021c0| 6f 63 6b 20 6f 66 20 76 | 69 72 74 75 61 6c 20 6d |ock of v|irtual m|
|000021d0| 65 6d 6f 72 79 2c 20 6f | 72 20 79 6f 75 20 67 65 |emory, o|r you ge|
|000021e0| 74 20 61 6e 20 65 72 72 | 6f 72 2c 20 73 69 6e 63 |t an err|or, sinc|
|000021f0| 65 2c 20 61 6d 6f 6e 67 | 20 6f 74 68 65 72 20 72 |e, among| other r|
|00002200| 65 61 73 6f 6e 73 2c 20 | 61 6e 79 20 70 61 67 69 |easons, |any pagi|
|00002210| 6e 67 20 61 63 74 69 76 | 69 74 79 20 63 6f 75 6c |ng activ|ity coul|
|00002220| 64 20 69 6e 76 61 6c 69 | 64 61 74 65 20 74 68 65 |d invali|date the|
|00002230| 20 72 65 73 75 6c 74 73 | 20 6f 66 20 61 20 47 65 | results| of a Ge|
|00002240| 74 50 68 79 73 69 63 61 | 6c 20 63 61 6c 6c 2e 20 |tPhysica|l call. |
|00002250| 20 41 6c 74 68 6f 75 67 | 68 20 69 74 20 69 73 20 | Althoug|h it is |
|00002260| 6e 6f 74 20 6e 65 63 65 | 73 73 61 72 79 20 74 6f |not nece|ssary to|
|00002270| 20 63 61 6c 6c 20 4c 6f | 63 6b 4d 65 6d 6f 72 79 | call Lo|ckMemory|
|00002280| 20 62 65 66 6f 72 65 20 | 47 65 74 50 68 79 73 69 | before |GetPhysi|
|00002290| 63 61 6c 20 69 66 20 56 | 4d 20 69 73 20 6e 6f 74 |cal if V|M is not|
|000022a0| 20 72 75 6e 6e 69 6e 67 | 2c 20 4c 6f 63 6b 4d 65 | running|, LockMe|
|000022b0| 6d 6f 72 79 20 6d 61 79 | 20 73 74 69 6c 6c 20 62 |mory may| still b|
|000022c0| 65 20 75 73 65 64 20 66 | 6f 72 20 69 74 73 20 66 |e used f|or its f|
|000022d0| 61 76 6f 72 61 62 6c 65 | 20 65 66 66 65 63 74 20 |avorable| effect |
|000022e0| 6f 66 20 64 69 73 61 62 | 6c 69 6e 67 20 63 61 63 |of disab|ling cac|
|000022f0| 68 69 6e 67 2e 20 20 54 | 68 69 73 20 4e 6f 74 65 |hing. T|his Note|
|00002300| 20 69 6e 63 6c 75 64 65 | 73 20 61 20 63 6f 64 65 | include|s a code|
|00002310| 20 74 65 6d 70 6c 61 74 | 65 20 28 6c 6f 63 61 74 | templat|e (locat|
|00002320| 65 64 20 61 74 20 74 68 | 65 20 65 6e 64 29 20 77 |ed at th|e end) w|
|00002330| 68 69 63 68 20 69 6c 6c | 75 73 74 72 61 74 65 73 |hich ill|ustrates|
|00002340| 20 61 20 d2 77 61 79 20 | 72 61 64 d3 20 6d 65 74 | a .way |rad. met|
|00002350| 68 6f 64 20 74 6f 20 69 | 6d 70 6c 65 6d 65 6e 74 |hod to i|mplement|
|00002360| 20 64 72 69 76 65 72 20 | 63 61 6c 6c 73 20 74 6f | driver |calls to|
|00002370| 20 61 20 67 65 6e 65 72 | 69 63 20 4e 75 42 75 73 | a gener|ic NuBus|
|00002380| 20 6d 61 73 74 65 72 20 | 63 61 72 64 2e 20 20 49 | master |card. I|
|00002390| 74 20 64 6f 65 73 6e d5 | 74 20 65 76 65 6e 20 68 |t doesn.|t even h|
|000023a0| 61 76 65 20 74 6f 20 6b | 6e 6f 77 20 69 66 20 56 |ave to k|now if V|
|000023b0| 4d 20 69 73 20 72 75 6e | 6e 69 6e 67 2e 20 20 48 |M is run|ning. H|
|000023c0| 61 72 64 77 61 72 65 20 | 61 6e 64 20 64 72 69 76 |ardware |and driv|
|000023d0| 65 72 73 20 73 68 6f 75 | 6c 64 20 62 65 20 64 65 |ers shou|ld be de|
|000023e0| 73 69 67 6e 65 64 20 74 | 6f 20 73 75 70 70 6f 72 |signed t|o suppor|
|000023f0| 74 20 74 68 69 73 20 6d | 65 74 68 6f 64 20 66 6f |t this m|ethod fo|
|00002400| 72 20 6d 61 78 69 6d 75 | 6d 20 56 4d 20 66 72 69 |r maximu|m VM fri|
|00002410| 65 6e 64 6c 69 6e 65 73 | 73 2e 0d 54 68 65 72 65 |endlines|s..There|
|00002420| 20 69 73 20 6f 6e 65 20 | 6d 6f 72 65 20 56 4d 20 | is one |more VM |
|00002430| 72 6f 75 74 69 6e 65 20 | 6f 66 20 69 6e 74 65 72 |routine |of inter|
|00002440| 65 73 74 2c 20 4c 6f 63 | 6b 4d 65 6d 6f 72 79 43 |est, Loc|kMemoryC|
|00002450| 6f 6e 74 69 67 75 6f 75 | 73 2c 20 77 68 69 63 68 |ontiguou|s, which|
|00002460| 20 69 73 20 70 72 6f 76 | 69 64 65 64 20 74 6f 20 | is prov|ided to |
|00002470| 61 73 73 69 73 74 20 64 | 65 76 65 6c 6f 70 65 72 |assist d|eveloper|
|00002480| 73 20 77 68 6f 73 65 20 | 44 4d 41 20 68 61 72 64 |s whose |DMA hard|
|00002490| 77 61 72 65 20 69 73 20 | 6e 6f 74 20 63 61 70 61 |ware is |not capa|
|000024a0| 62 6c 65 20 6f 66 20 74 | 72 61 6e 73 66 65 72 72 |ble of t|ransferr|
|000024b0| 69 6e 67 20 62 6c 6f 63 | 6b 73 20 6f 66 20 61 72 |ing bloc|ks of ar|
|000024c0| 62 69 74 72 61 72 79 20 | 73 69 7a 65 20 6f 72 20 |bitrary |size or |
|000024d0| 66 6f 72 20 73 6f 6d 65 | 20 6f 74 68 65 72 20 72 |for some| other r|
|000024e0| 65 61 73 6f 6e 20 63 61 | 6e 6e 6f 74 20 75 73 65 |eason ca|nnot use|
|000024f0| 20 61 20 67 65 6e 65 72 | 61 6c 69 7a 65 64 20 61 | a gener|alized a|
|00002500| 6c 67 6f 72 69 74 68 6d | 20 73 75 63 68 20 61 73 |lgorithm| such as|
|00002510| 20 74 68 65 20 6f 6e 65 | 20 70 72 6f 76 69 64 65 | the one| provide|
|00002520| 64 2e 20 20 41 70 70 6c | 65 20 63 61 6e 20 6f 6e |d. Appl|e can on|
|00002530| 6c 79 20 77 61 72 6e 20 | 64 65 76 65 6c 6f 70 65 |ly warn |develope|
|00002540| 72 73 20 74 68 61 74 20 | 4c 6f 63 6b 4d 65 6d 6f |rs that |LockMemo|
|00002550| 72 79 43 6f 6e 74 69 67 | 75 6f 75 73 20 69 73 20 |ryContig|uous is |
|00002560| 70 6f 74 65 6e 74 69 61 | 6c 6c 79 20 61 6e 20 65 |potentia|lly an e|
|00002570| 78 70 65 6e 73 69 76 65 | 20 6f 70 65 72 61 74 69 |xpensive| operati|
|00002580| 6f 6e 20 69 6e 20 74 65 | 72 6d 73 20 6f 66 20 70 |on in te|rms of p|
|00002590| 65 72 66 6f 72 6d 61 6e | 63 65 20 61 6e 64 20 69 |erforman|ce and i|
|000025a0| 73 20 6f 6e 65 20 76 65 | 72 79 20 6c 69 6b 65 6c |s one ve|ry likel|
|000025b0| 79 20 74 6f 20 66 61 69 | 6c 20 73 69 6e 63 65 20 |y to fai|l since |
|000025c0| 63 6f 6e 74 69 67 75 6f | 75 73 20 70 68 79 73 69 |contiguo|us physi|
|000025d0| 63 61 6c 20 6d 65 6d 6f | 72 79 20 6d 61 79 20 62 |cal memo|ry may b|
|000025e0| 65 20 64 69 66 66 69 63 | 75 6c 74 2c 20 69 66 20 |e diffic|ult, if |
|000025f0| 6e 6f 74 20 69 6d 70 6f | 73 73 69 62 6c 65 2c 20 |not impo|ssible, |
|00002600| 74 6f 20 66 69 6e 64 2e | 20 20 4c 6f 63 6b 4d 65 |to find.| LockMe|
|00002610| 6d 6f 72 79 43 6f 6e 74 | 69 67 75 6f 75 73 20 69 |moryCont|iguous i|
|00002620| 73 20 6e 6f 74 20 70 61 | 72 74 69 63 75 6c 61 72 |s not pa|rticular|
|00002630| 6c 79 20 75 73 65 66 75 | 6c 2c 20 75 6e 6c 65 73 |ly usefu|l, unles|
|00002640| 73 20 56 4d 20 69 73 20 | 72 75 6e 6e 69 6e 67 2c |s VM is |running,|
|00002650| 20 73 68 6f 75 6c 64 20 | 61 20 72 61 6e 67 65 20 | should |a range |
|00002660| 6f 66 20 6d 65 6d 6f 72 | 79 20 68 61 70 70 65 6e |of memor|y happen|
|00002670| 20 74 6f 20 63 72 6f 73 | 73 20 61 20 70 68 79 73 | to cros|s a phys|
|00002680| 69 63 61 6c 20 64 69 73 | 63 6f 6e 74 69 6e 75 69 |ical dis|continui|
|00002690| 74 79 20 6c 69 6b 65 20 | 74 68 61 74 20 66 6f 75 |ty like |that fou|
|000026a0| 6e 64 20 6f 6e 20 61 20 | 4d 61 63 69 6e 74 6f 73 |nd on a |Macintos|
|000026b0| 68 20 49 49 63 69 2e 20 | 20 4e 6f 20 68 61 72 64 |h IIci. | No hard|
|000026c0| 77 61 72 65 20 6f 72 20 | 73 6f 66 74 77 61 72 65 |ware or |software|
|000026d0| 20 70 72 6f 64 75 63 74 | 20 73 68 6f 75 6c 64 20 | product| should |
|000026e0| 72 65 71 75 69 72 65 20 | 56 4d 20 69 6e 20 6f 72 |require |VM in or|
|000026f0| 64 65 72 20 74 6f 20 72 | 75 6e 2e 20 20 4c 6f 63 |der to r|un. Loc|
|00002700| 6b 4d 65 6d 6f 72 79 43 | 6f 6e 74 69 67 75 6f 75 |kMemoryC|ontiguou|
|00002710| 73 20 6d 69 67 68 74 20 | 62 65 20 75 73 65 66 75 |s might |be usefu|
|00002720| 6c 20 66 6f 72 20 64 65 | 74 65 72 6d 69 6e 69 6e |l for de|terminin|
|00002730| 67 20 77 68 65 74 68 65 | 72 20 61 20 72 61 6e 67 |g whethe|r a rang|
|00002740| 65 20 6f 66 20 6c 6f 67 | 69 63 61 6c 20 6d 65 6d |e of log|ical mem|
|00002750| 6f 72 79 20 69 73 20 61 | 63 74 75 61 6c 6c 79 20 |ory is a|ctually |
|00002760| 70 68 79 73 69 63 61 6c | 6c 79 20 63 6f 6e 74 69 |physical|ly conti|
|00002770| 67 75 6f 75 73 2c 20 61 | 6c 74 68 6f 75 67 68 20 |guous, a|lthough |
|00002780| 47 65 74 50 68 79 73 69 | 63 61 6c 20 63 61 6e 20 |GetPhysi|cal can |
|00002790| 64 6f 20 74 68 65 20 73 | 61 6d 65 20 74 68 69 6e |do the s|ame thin|
|000027a0| 67 20 77 69 74 68 6f 75 | 74 20 61 63 74 75 61 6c |g withou|t actual|
|000027b0| 6c 79 20 6c 6f 63 6b 69 | 6e 67 20 74 68 65 20 6d |ly locki|ng the m|
|000027c0| 65 6d 6f 72 79 2e 0d 41 | 70 70 6c 65 d5 73 20 70 |emory..A|pple.s p|
|000027d0| 72 69 6d 61 72 79 20 72 | 65 63 6f 6d 6d 65 6e 64 |rimary r|ecommend|
|000027e0| 61 74 69 6f 6e 20 72 65 | 67 61 72 64 69 6e 67 20 |ation re|garding |
|000027f0| 4c 6f 63 6b 4d 65 6d 6f | 72 79 43 6f 6e 74 69 67 |LockMemo|ryContig|
|00002800| 75 6f 75 73 20 69 73 20 | 74 6f 20 61 76 6f 69 64 |uous is |to avoid|
|00002810| 20 69 74 73 20 75 73 65 | 20 69 66 20 61 74 20 61 | its use| if at a|
|00002820| 6c 6c 20 70 6f 73 73 69 | 62 6c 65 2e 20 20 49 66 |ll possi|ble. If|
|00002830| 20 79 6f 75 20 6d 75 73 | 74 20 75 73 65 20 4c 6f | you mus|t use Lo|
|00002840| 63 6b 4d 65 6d 6f 72 79 | 43 6f 6e 74 69 67 75 6f |ckMemory|Contiguo|
|00002850| 75 73 2c 20 41 70 70 6c | 65 20 72 65 63 6f 6d 6d |us, Appl|e recomm|
|00002860| 65 6e 64 73 20 74 68 61 | 74 20 79 6f 75 20 61 6c |ends tha|t you al|
|00002870| 6c 6f 63 61 74 65 20 79 | 6f 75 72 20 62 75 66 66 |locate y|our buff|
|00002880| 65 72 20 61 73 20 65 61 | 72 6c 79 20 61 73 20 70 |er as ea|rly as p|
|00002890| 6f 73 73 69 62 6c 65 20 | 28 70 72 65 66 65 72 61 |ossible |(prefera|
|000028a0| 62 6c 79 20 61 74 20 73 | 74 61 72 74 75 70 29 20 |bly at s|tartup) |
|000028b0| 61 6e 64 20 6c 6f 63 6b | 20 69 74 20 64 6f 77 6e |and lock| it down|
|000028c0| 20 63 6f 6e 74 69 67 75 | 6f 75 73 6c 79 20 61 74 | contigu|ously at|
|000028d0| 20 74 68 61 74 20 74 69 | 6d 65 2e 20 20 56 4d 20 | that ti|me. VM |
|000028e0| 69 73 20 61 6e 20 65 6e | 74 72 6f 70 69 63 20 73 |is an en|tropic s|
|000028f0| 79 73 74 65 6d 2c 20 6d | 65 61 6e 69 6e 67 20 69 |ystem, m|eaning i|
|00002900| 74 73 20 70 61 67 65 73 | 20 74 65 6e 64 20 74 6f |ts pages| tend to|
|00002910| 20 62 65 63 6f 6d 65 20 | 73 68 75 66 66 6c 65 64 | become |shuffled|
|00002920| 20 6f 76 65 72 20 74 69 | 6d 65 2c 20 73 6f 20 69 | over ti|me, so i|
|00002930| 74 d5 73 20 65 61 73 69 | 65 73 74 20 74 6f 20 66 |t.s easi|est to f|
|00002940| 69 6e 64 20 63 6f 6e 74 | 69 67 75 6f 75 73 20 6d |ind cont|iguous m|
|00002950| 65 6d 6f 72 79 20 65 61 | 72 6c 79 20 69 6e 20 61 |emory ea|rly in a|
|00002960| 20 73 65 73 73 69 6f 6e | 2e 0d 57 68 65 6e 20 74 | session|..When t|
|00002970| 6f 20 43 61 6c 6c 3f 0d | 48 6f 6c 64 4d 65 6d 6f |o Call?.|HoldMemo|
|00002980| 72 79 0d a5 09 42 65 66 | 6f 72 65 20 74 61 6b 69 |ry...Bef|ore taki|
|00002990| 6e 67 20 63 6f 6e 74 72 | 6f 6c 20 6f 66 20 74 68 |ng contr|ol of th|
|000029a0| 65 20 53 43 53 49 20 62 | 75 73 2e 0d a5 09 42 65 |e SCSI b|us....Be|
|000029b0| 66 6f 72 65 20 61 63 63 | 65 73 73 69 6e 67 20 6d |fore acc|essing m|
|000029c0| 65 6d 6f 72 79 20 61 74 | 20 69 6e 74 65 72 72 75 |emory at| interru|
|000029d0| 70 74 20 74 69 6d 65 2e | 0d a5 09 54 6f 20 6b 65 |pt time.|...To ke|
|000029e0| 65 70 20 63 72 69 74 69 | 63 61 6c 20 72 61 6e 67 |ep criti|cal rang|
|000029f0| 65 73 20 6f 66 20 6d 65 | 6d 6f 72 79 20 72 65 73 |es of me|mory res|
|00002a00| 69 64 65 6e 74 20 66 6f | 72 20 70 65 72 66 6f 72 |ident fo|r perfor|
|00002a10| 6d 61 6e 63 65 20 72 65 | 61 73 6f 6e 73 2e 0d 4c |mance re|asons..L|
|00002a20| 6f 63 6b 4d 65 6d 6f 72 | 79 0d a5 60 09 52 61 72 |ockMemor|y..`.Rar|
|00002a30| 65 6c 79 2e 20 20 28 41 | 6c 77 61 79 73 20 55 6e |ely. (A|lways Un|
|00002a40| 6c 6f 63 6b 4d 65 6d 6f | 72 79 20 61 73 20 73 6f |lockMemo|ry as so|
|00002a50| 6f 6e 20 61 73 20 70 6f | 73 73 69 62 6c 65 2e 29 |on as po|ssible.)|
|00002a60| 0d a5 09 42 65 66 6f 72 | 65 20 63 61 6c 6c 69 6e |...Befor|e callin|
|00002a70| 67 20 47 65 74 50 68 79 | 73 69 63 61 6c 2e 0d a5 |g GetPhy|sical...|
|00002a80| 09 42 65 66 6f 72 65 20 | 69 6e 69 74 69 61 74 69 |.Before |initiati|
|00002a90| 6e 67 20 61 20 44 4d 41 | 20 74 72 61 6e 73 66 65 |ng a DMA| transfe|
|00002aa0| 72 2e 0d 4c 6f 63 6b 4d | 65 6d 6f 72 79 43 6f 6e |r..LockM|emoryCon|
|00002ab0| 74 69 67 75 6f 75 73 0d | a5 20 20 4e 65 76 65 72 |tiguous.|. Never|
|00002ac0| 2c 20 69 66 20 79 6f 75 | 20 63 61 6e 20 68 65 6c |, if you| can hel|
|00002ad0| 70 20 69 74 2e 20 20 28 | 49 66 20 6e 65 63 65 73 |p it. (|If neces|
|00002ae0| 73 61 72 79 2c 20 64 6f | 20 73 6f 20 61 73 20 65 |sary, do| so as e|
|00002af0| 61 72 6c 79 20 61 73 20 | 70 6f 73 73 69 62 6c 65 |arly as |possible|
|00002b00| d1 73 65 65 20 74 65 78 | 74 20 61 62 6f 76 65 29 |.see tex|t above)|
|00002b10| 2e 0d 57 68 65 6e 20 4e | 6f 74 20 74 6f 20 43 61 |..When N|ot to Ca|
|00002b20| 6c 6c 3f 0d 48 6f 6c 64 | 4d 65 6d 6f 72 79 0d a5 |ll?.Hold|Memory..|
|00002b30| 09 54 6f 20 6b 65 65 70 | 20 6c 61 72 67 65 20 72 |.To keep| large r|
|00002b40| 61 6e 67 65 73 20 6f 66 | 20 6d 65 6d 6f 72 79 20 |anges of| memory |
|00002b50| 72 65 73 69 64 65 6e 74 | 20 66 6f 72 20 70 65 72 |resident| for per|
|00002b60| 66 6f 72 6d 61 6e 63 65 | 20 72 65 61 73 6f 6e 73 |formance| reasons|
|00002b70| 2e 0d 4c 6f 63 6b 4d 65 | 6d 6f 72 79 0d a5 09 42 |..LockMe|mory...B|
|00002b80| 65 66 6f 72 65 20 64 65 | 72 65 66 65 72 65 6e 63 |efore de|referenc|
|00002b90| 69 6e 67 20 61 20 68 61 | 6e 64 6c 65 2e 20 20 28 |ing a ha|ndle. (|
|00002ba0| 4c 6f 63 6b 4d 65 6d 6f | 72 79 20 73 68 6f 75 6c |LockMemo|ry shoul|
|00002bb0| 64 20 6e 6f 74 20 62 65 | 20 63 6f 6e 66 75 73 65 |d not be| confuse|
|00002bc0| 64 20 77 69 74 68 20 5f | 48 4c 6f 63 6b 2e 29 0d |d with _|HLock.).|
|00002bd0| a5 09 57 68 65 6e 20 79 | 6f 75 20 72 65 61 6c 6c |..When y|ou reall|
|00002be0| 79 20 6d 65 61 6e 20 48 | 6f 6c 64 4d 65 6d 6f 72 |y mean H|oldMemor|
|00002bf0| 79 2e 0d 57 68 61 74 20 | 46 6f 72 6d 20 4f 66 20 |y..What |Form Of |
|00002c00| 41 64 64 72 65 73 73 20 | 54 6f 20 50 61 73 73 3f |Address |To Pass?|
|00002c10| 0d 41 6c 6c 20 5f 4d 65 | 6d 6f 72 79 44 69 73 70 |.All _Me|moryDisp|
|00002c20| 61 74 63 68 20 72 6f 75 | 74 69 6e 65 73 20 64 65 |atch rou|tines de|
|00002c30| 73 63 72 69 62 65 64 20 | 61 62 6f 76 65 20 77 6f |scribed |above wo|
|00002c40| 72 6b 20 61 73 20 65 78 | 70 65 63 74 65 64 20 69 |rk as ex|pected i|
|00002c50| 6e 20 65 69 74 68 65 72 | 20 32 34 2d 62 69 74 20 |n either| 24-bit |
|00002c60| 6d 6f 64 65 20 6f 72 20 | 33 32 2d 62 69 74 20 6d |mode or |32-bit m|
|00002c70| 6f 64 65 2e 20 20 49 6e | 20 32 34 2d 62 69 74 20 |ode. In| 24-bit |
|00002c80| 6d 6f 64 65 2c 20 66 6f | 72 20 69 6e 73 74 61 6e |mode, fo|r instan|
|00002c90| 63 65 2c 20 6d 61 73 74 | 65 72 20 70 6f 69 6e 74 |ce, mast|er point|
|00002ca0| 65 72 20 66 6c 61 67 73 | 20 6f 72 20 6f 74 68 65 |er flags| or othe|
|00002cb0| 72 20 67 61 72 62 61 67 | 65 20 62 69 74 73 20 69 |r garbag|e bits i|
|00002cc0| 6e 20 74 68 65 20 68 69 | 67 68 2d 6f 72 64 65 72 |n the hi|gh-order|
|00002cd0| 20 65 69 67 68 74 20 62 | 69 74 73 20 61 72 65 20 | eight b|its are |
|00002ce0| 69 67 6e 6f 72 65 64 20 | 61 6e 64 20 74 61 6b 65 |ignored |and take|
|00002cf0| 6e 20 74 6f 20 62 65 20 | 7a 65 72 6f 2e 20 20 57 |n to be |zero. W|
|00002d00| 68 65 6e 20 73 77 69 74 | 63 68 69 6e 67 20 62 65 |hen swit|ching be|
|00002d10| 74 77 65 65 6e 20 32 34 | 2d 62 69 74 20 61 6e 64 |tween 24|-bit and|
|00002d20| 20 33 32 2d 62 69 74 20 | 6d 6f 64 65 73 2c 20 72 | 32-bit |modes, r|
|00002d30| 65 6d 65 6d 62 65 72 20 | 74 6f 20 75 73 65 20 5f |emember |to use _|
|00002d40| 53 74 72 69 70 41 64 64 | 72 65 73 73 20 61 73 20 |StripAdd|ress as |
|00002d50| 6f 75 74 6c 69 6e 65 64 | 20 69 6e 20 54 65 63 68 |outlined| in Tech|
|00002d60| 6e 69 63 61 6c 20 4e 6f | 74 65 20 4d 45 20 36 2c |nical No|te ME 6,|
|00002d70| 20 5f 53 74 72 69 70 41 | 64 64 72 65 73 73 3a 20 | _StripA|ddress: |
|00002d80| 20 54 68 65 20 55 6e 74 | 6f 6c 64 20 53 74 6f 72 | The Unt|old Stor|
|00002d90| 79 2e 0d 53 70 65 63 69 | 61 6c 20 43 6f 6e 73 69 |y..Speci|al Consi|
|00002da0| 64 65 72 61 74 69 6f 6e | 73 0d 54 68 65 20 47 65 |deration|s.The Ge|
|00002db0| 74 50 68 79 73 69 63 61 | 6c 20 63 61 6c 6c 20 69 |tPhysica|l call i|
|00002dc0| 6e 20 52 4f 4d 20 61 6e | 64 20 73 79 73 74 65 6d |n ROM an|d system|
|00002dd0| 20 73 6f 66 74 77 61 72 | 65 20 63 75 72 72 65 6e | softwar|e curren|
|00002de0| 74 6c 79 20 73 75 70 70 | 6f 72 74 73 20 6f 6e 6c |tly supp|orts onl|
|00002df0| 79 20 6c 6f 67 69 63 61 | 6c 20 52 41 4d 2e 20 20 |y logica|l RAM. |
|00002e00| 54 68 69 73 20 65 78 63 | 6c 75 64 65 73 20 74 68 |This exc|ludes th|
|00002e10| 65 20 52 4f 4d 2c 20 49 | 2f 4f 2c 20 61 6e 64 20 |e ROM, I|/O, and |
|00002e20| 4e 75 42 75 73 20 73 70 | 61 63 65 73 20 66 72 6f |NuBus sp|aces fro|
|00002e30| 6d 20 74 68 65 20 73 65 | 74 20 6f 66 20 61 64 64 |m the se|t of add|
|00002e40| 72 65 73 73 65 73 20 47 | 65 74 50 68 79 73 69 63 |resses G|etPhysic|
|00002e50| 61 6c 20 6b 6e 6f 77 73 | 20 68 6f 77 20 74 6f 20 |al knows| how to |
|00002e60| 74 72 61 6e 73 6c 61 74 | 65 2e 20 20 55 6e 66 6f |translat|e. Unfo|
|00002e70| 72 74 75 6e 61 74 65 6c | 79 2c 20 6d 61 63 68 69 |rtunatel|y, machi|
|00002e80| 6e 65 73 20 6c 69 6b 65 | 20 74 68 65 20 4d 61 63 |nes like| the Mac|
|00002e90| 69 6e 74 6f 73 68 20 49 | 49 63 69 20 61 6e 64 20 |intosh I|Ici and |
|00002ea0| 4d 61 63 69 6e 74 6f 73 | 68 20 49 49 73 69 20 75 |Macintos|h IIsi u|
|00002eb0| 73 65 20 74 68 65 20 4d | 4d 55 20 74 6f 20 6d 61 |se the M|MU to ma|
|00002ec0| 70 20 61 20 73 6d 61 6c | 6c 20 61 6d 6f 75 6e 74 |p a smal|l amount|
|00002ed0| 20 6f 66 20 70 68 79 73 | 69 63 61 6c 20 6d 65 6d | of phys|ical mem|
|00002ee0| 6f 72 79 20 69 6e 74 6f | 20 4e 75 42 75 73 20 73 |ory into| NuBus s|
|00002ef0| 70 61 63 65 20 73 6f 20 | 74 68 61 74 20 69 74 20 |pace so |that it |
|00002f00| 6c 6f 6f 6b 73 20 6c 69 | 6b 65 20 61 20 72 65 67 |looks li|ke a reg|
|00002f10| 75 6c 61 72 20 76 69 64 | 65 6f 20 63 61 72 64 2e |ular vid|eo card.|
|00002f20| 20 20 49 64 65 61 6c 6c | 79 20 6f 6e 65 20 6d 69 | Ideall|y one mi|
|00002f30| 67 68 74 20 6c 69 6b 65 | 20 74 6f 20 75 73 65 20 |ght like| to use |
|00002f40| 47 65 74 50 68 79 73 69 | 63 61 6c 20 74 6f 20 67 |GetPhysi|cal to g|
|00002f50| 65 74 20 74 68 65 20 61 | 63 74 75 61 6c 20 52 41 |et the a|ctual RA|
|00002f60| 4d 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |M addres|s of the|
|00002f70| 20 76 69 64 65 6f 20 62 | 75 66 66 65 72 20 28 74 | video b|uffer (t|
|00002f80| 6f 20 70 72 6f 76 69 64 | 65 20 44 4d 41 20 73 75 |o provid|e DMA su|
|00002f90| 70 70 6f 72 74 20 66 6f | 72 20 63 65 72 74 61 69 |pport fo|r certai|
|00002fa0| 6e 20 6d 75 6c 74 69 6d | 65 64 69 61 20 70 72 6f |n multim|edia pro|
|00002fb0| 64 75 63 74 73 20 61 6e | 64 20 67 72 61 70 68 69 |ducts an|d graphi|
|00002fc0| 63 73 20 61 63 63 65 6c | 65 72 61 74 6f 72 73 29 |cs accel|erators)|
|00002fd0| 2c 20 62 75 74 20 74 68 | 65 20 63 75 72 72 65 6e |, but th|e curren|
|00002fe0| 74 20 52 4f 4d 20 69 6d | 70 6c 65 6d 65 6e 74 61 |t ROM im|plementa|
|00002ff0| 74 69 6f 6e 20 6f 66 20 | 47 65 74 50 68 79 73 69 |tion of |GetPhysi|
|00003000| 63 61 6c 20 72 65 74 75 | 72 6e 73 20 61 20 70 61 |cal retu|rns a pa|
|00003010| 72 61 6d 45 72 72 20 28 | 2d 35 30 29 20 69 6e 20 |ramErr (|-50) in |
|00003020| 72 65 73 70 6f 6e 73 65 | 20 74 6f 20 6c 6f 67 69 |response| to logi|
|00003030| 63 61 6c 20 4e 75 42 75 | 73 20 61 64 64 72 65 73 |cal NuBu|s addres|
|00003040| 73 65 73 2e 0d 42 65 63 | 61 75 73 65 20 69 74 73 |ses..Bec|ause its|
|00003050| 20 52 4f 4d 20 69 73 20 | 64 65 72 69 76 65 64 20 | ROM is |derived |
|00003060| 66 72 6f 6d 20 74 68 61 | 74 20 6f 66 20 74 68 65 |from tha|t of the|
|00003070| 20 4d 61 63 69 6e 74 6f | 73 68 20 49 49 63 69 2c | Macinto|sh IIci,|
|00003080| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 4c | the Mac|intosh L|
|00003090| 43 20 6d 61 79 20 61 70 | 70 65 61 72 20 74 6f 20 |C may ap|pear to |
|000030a0| 68 61 76 65 20 5f 4d 65 | 6d 6f 72 79 44 69 73 70 |have _Me|moryDisp|
|000030b0| 61 74 63 68 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |atch imp|lemented|
|000030c0| 2e 20 20 54 68 69 73 20 | 64 6f 65 73 6e d5 74 20 |. This |doesn.t |
|000030d0| 6d 61 6b 65 20 73 65 6e | 73 65 2c 20 68 6f 77 65 |make sen|se, howe|
|000030e0| 76 65 72 2c 20 62 65 63 | 61 75 73 65 20 74 68 65 |ver, bec|ause the|
|000030f0| 20 4c 43 20 68 61 73 20 | 6e 6f 20 4d 4d 55 2e 20 | LC has |no MMU. |
|00003100| 20 41 6c 74 68 6f 75 67 | 68 20 53 79 73 74 65 6d | Althoug|h System|
|00003110| 20 53 6f 66 74 77 61 72 | 65 20 37 2e 30 20 70 61 | Softwar|e 7.0 pa|
|00003120| 74 63 68 65 73 20 5f 4d | 65 6d 6f 72 79 44 69 73 |tches _M|emoryDis|
|00003130| 70 61 74 63 68 20 69 6e | 20 74 68 69 73 20 63 61 |patch in| this ca|
|00003140| 73 65 20 74 6f 20 6d 61 | 6b 65 20 69 74 20 75 6e |se to ma|ke it un|
|00003150| 69 6d 70 6c 65 6d 65 6e | 74 65 64 2c 20 50 72 69 |implemen|ted, Pri|
|00003160| 6d 61 72 79 49 6e 69 74 | 20 63 6f 64 65 20 61 6e |maryInit| code an|
|00003170| 64 20 53 43 53 49 20 64 | 72 69 76 65 72 73 20 77 |d SCSI d|rivers w|
|00003180| 68 69 63 68 20 72 75 6e | 20 62 65 66 6f 72 65 20 |hich run| before |
|00003190| 73 79 73 74 65 6d 20 70 | 61 74 63 68 65 73 20 61 |system p|atches a|
|000031a0| 72 65 20 69 6e 73 74 61 | 6c 6c 65 64 20 63 6f 75 |re insta|lled cou|
|000031b0| 6c 64 20 62 65 20 61 66 | 66 65 63 74 65 64 2e 20 |ld be af|fected. |
|000031c0| 20 43 6f 64 65 20 72 75 | 6e 6e 69 6e 67 20 61 74 | Code ru|nning at|
|000031d0| 20 74 68 69 73 20 74 69 | 6d 65 20 73 68 6f 75 6c | this ti|me shoul|
|000031e0| 64 20 71 75 61 6c 69 66 | 79 20 74 68 65 20 65 78 |d qualif|y the ex|
|000031f0| 69 73 74 65 6e 63 65 20 | 6f 66 20 5f 4d 65 6d 6f |istence |of _Memo|
|00003200| 72 79 44 69 73 70 61 74 | 63 68 20 77 69 74 68 20 |ryDispat|ch with |
|00003210| 74 68 65 20 65 78 69 73 | 74 65 6e 63 65 20 6f 66 |the exis|tence of|
|00003220| 20 61 6e 20 4d 4d 55 2c | 20 75 73 69 6e 67 20 5f | an MMU,| using _|
|00003230| 47 65 73 74 61 6c 74 2e | 0d 49 6e 20 6f 72 64 65 |Gestalt.|.In orde|
|00003240| 72 20 74 6f 20 73 6f 6c | 76 65 20 62 6f 74 68 20 |r to sol|ve both |
|00003250| 6f 66 20 74 68 65 73 65 | 20 70 72 6f 62 6c 65 6d |of these| problem|
|00003260| 73 20 61 73 20 63 6c 65 | 61 6e 6c 79 20 61 73 20 |s as cle|anly as |
|00003270| 70 6f 73 73 69 62 6c 65 | 2c 20 74 68 65 20 4d 50 |possible|, the MP|
|00003280| 57 20 6c 69 62 72 61 72 | 69 65 73 20 63 6f 6e 74 |W librar|ies cont|
|00003290| 61 69 6e 20 61 6e 20 65 | 6e 68 61 6e 63 65 64 20 |ain an e|nhanced |
|000032a0| 76 65 72 73 69 6f 6e 20 | 6f 66 20 47 65 74 50 68 |version |of GetPh|
|000032b0| 79 73 69 63 61 6c 20 77 | 69 74 68 20 67 72 65 61 |ysical w|ith grea|
|000032c0| 74 65 72 20 66 6c 65 78 | 69 62 69 6c 69 74 79 20 |ter flex|ibility |
|000032d0| 74 68 61 6e 20 74 68 65 | 20 52 4f 4d 20 76 65 72 |than the| ROM ver|
|000032e0| 73 69 6f 6e 2e 2a 20 41 | 6c 74 68 6f 75 67 68 20 |sion.* A|lthough |
|000032f0| 74 68 65 20 65 6e 68 61 | 6e 63 65 64 20 76 65 72 |the enha|nced ver|
|00003300| 73 69 6f 6e 20 69 73 20 | 74 68 65 20 73 61 6d 65 |sion is |the same|
|00003310| 20 61 73 20 74 68 65 20 | 52 4f 4d 20 76 65 72 73 | as the |ROM vers|
|00003320| 69 6f 6e 20 69 6e 20 6d | 6f 73 74 20 63 61 73 65 |ion in m|ost case|
|00003330| 73 2c 20 69 74 20 70 72 | 6f 76 69 64 65 73 20 65 |s, it pr|ovides e|
|00003340| 78 74 72 61 20 76 61 6c | 69 64 61 74 69 6f 6e 20 |xtra val|idation |
|00003350| 63 68 65 63 6b 73 20 74 | 6f 20 67 75 61 72 61 6e |checks t|o guaran|
|00003360| 74 65 65 20 73 74 61 62 | 69 6c 69 74 79 20 62 65 |tee stab|ility be|
|00003370| 66 6f 72 65 20 73 79 73 | 74 65 6d 20 70 61 74 63 |fore sys|tem patc|
|00003380| 68 65 73 20 61 72 65 20 | 69 6e 73 74 61 6c 6c 65 |hes are |installe|
|00003390| 64 2c 20 61 6e 64 20 69 | 74 20 61 70 70 6c 69 65 |d, and i|t applie|
|000033a0| 73 20 61 6c 74 65 72 6e | 61 74 65 20 6d 65 63 68 |s altern|ate mech|
|000033b0| 61 6e 69 73 6d 73 20 74 | 6f 20 64 65 74 65 72 6d |anisms t|o determ|
|000033c0| 69 6e 65 20 74 68 65 20 | 70 68 79 73 69 63 61 6c |ine the |physical|
|000033d0| 20 61 64 64 72 65 73 73 | 20 6f 66 20 61 20 52 41 | address| of a RA|
|000033e0| 4d 2d 62 61 73 65 64 20 | 76 69 64 65 6f 20 62 75 |M-based |video bu|
|000033f0| 66 66 65 72 2e 20 20 59 | 6f 75 20 73 68 6f 75 6c |ffer. Y|ou shoul|
|00003400| 64 20 74 68 65 72 65 66 | 6f 72 65 20 63 61 6c 6c |d theref|ore call|
|00003410| 20 47 65 74 50 68 79 73 | 69 63 61 6c 20 77 68 65 | GetPhys|ical whe|
|00003420| 72 65 20 69 74 20 69 73 | 20 69 6e 64 69 63 61 74 |re it is| indicat|
|00003430| 65 64 2c 20 65 76 65 6e | 20 66 6f 72 20 61 64 64 |ed, even| for add|
|00003440| 72 65 73 73 20 73 70 61 | 63 65 73 20 77 68 65 72 |ress spa|ces wher|
|00003450| 65 20 74 68 65 20 52 4f | 4d 20 76 65 72 73 69 6f |e the RO|M versio|
|00003460| 6e 20 69 73 20 6b 6e 6f | 77 6e 20 74 6f 20 72 65 |n is kno|wn to re|
|00003470| 74 75 72 6e 20 61 6e 20 | 65 72 72 6f 72 2e 20 20 |turn an |error. |
|00003480| 54 68 65 20 67 6c 75 65 | 20 63 6f 64 65 20 6d 61 |The glue| code ma|
|00003490| 79 20 70 69 63 6b 20 75 | 70 20 74 68 65 20 73 6c |y pick u|p the sl|
|000034a0| 61 63 6b 20 6f 72 20 61 | 20 66 75 74 75 72 65 20 |ack or a| future |
|000034b0| 52 4f 4d 20 6d 69 67 68 | 74 20 6e 6f 74 20 72 65 |ROM migh|t not re|
|000034c0| 74 75 72 6e 20 61 6e 20 | 65 72 72 6f 72 2e 20 20 |turn an |error. |
|000034d0| 49 6e 20 61 6e 79 20 63 | 61 73 65 2c 20 79 6f 75 |In any c|ase, you|
|000034e0| 72 20 63 6f 64 65 20 73 | 68 6f 75 6c 64 20 61 6c |r code s|hould al|
|000034f0| 77 61 79 73 20 62 65 20 | 70 72 65 70 61 72 65 64 |ways be |prepared|
|00003500| 20 74 6f 20 63 6f 70 65 | 20 77 69 74 68 20 61 6e | to cope| with an|
|00003510| 79 20 6f 66 20 74 68 65 | 20 47 65 74 50 68 79 73 |y of the| GetPhys|
|00003520| 69 63 61 6c 20 65 72 72 | 6f 72 20 72 65 73 75 6c |ical err|or resul|
|00003530| 74 73 20 64 6f 63 75 6d | 65 6e 74 65 64 20 69 6e |ts docum|ented in|
|00003540| 20 49 6e 73 69 64 65 20 | 4d 61 63 69 6e 74 6f 73 | Inside |Macintos|
|00003550| 68 2e 20 20 52 65 6d 65 | 6d 62 65 72 20 61 6c 77 |h. Reme|mber alw|
|00003560| 61 79 73 20 74 6f 20 63 | 61 6c 6c 20 4c 6f 63 6b |ays to c|all Lock|
|00003570| 4d 65 6d 6f 72 79 20 62 | 65 66 6f 72 65 20 63 61 |Memory b|efore ca|
|00003580| 6c 6c 69 6e 67 20 47 65 | 74 50 68 79 73 69 63 61 |lling Ge|tPhysica|
|00003590| 6c 2c 20 61 6e 64 20 55 | 6e 6c 6f 63 6b 4d 65 6d |l, and U|nlockMem|
|000035a0| 6f 72 79 20 61 73 20 73 | 6f 6f 6e 20 61 73 20 70 |ory as s|oon as p|
|000035b0| 6f 73 73 69 62 6c 65 20 | 61 66 74 65 72 77 61 72 |ossible |afterwar|
|000035c0| 64 73 2e 0d 28 2a 41 74 | 20 74 68 69 73 20 77 72 |ds..(*At| this wr|
|000035d0| 69 74 69 6e 67 2c 20 74 | 68 65 20 65 6e 68 61 6e |iting, t|he enhan|
|000035e0| 63 65 64 20 47 65 74 50 | 68 79 73 69 63 61 6c 20 |ced GetP|hysical |
|000035f0| 63 6f 64 65 20 68 61 73 | 20 6e 6f 74 20 79 65 74 |code has| not yet|
|00003600| 20 62 65 65 6e 20 69 6e | 63 6f 72 70 6f 72 61 74 | been in|corporat|
|00003610| 65 64 20 69 6e 74 6f 20 | 62 65 74 61 20 76 65 72 |ed into |beta ver|
|00003620| 73 69 6f 6e 73 20 6f 66 | 20 74 68 65 20 53 79 73 |sions of| the Sys|
|00003630| 74 65 6d 20 37 2e 30 20 | 69 6e 74 65 72 66 61 63 |tem 7.0 |interfac|
|00003640| 65 20 6c 69 62 72 61 72 | 69 65 73 2e 20 20 54 68 |e librar|ies. Th|
|00003650| 69 73 20 63 6f 64 65 20 | 77 69 6c 6c 20 62 65 20 |is code |will be |
|00003660| 6d 61 64 65 20 61 76 61 | 69 6c 61 62 6c 65 20 61 |made ava|ilable a|
|00003670| 74 20 74 68 65 20 65 61 | 72 6c 69 65 73 74 20 6f |t the ea|rliest o|
|00003680| 70 70 6f 72 74 75 6e 69 | 74 79 20 61 6e 64 20 74 |pportuni|ty and t|
|00003690| 68 69 73 20 4e 6f 74 65 | 20 77 69 6c 6c 20 62 65 |his Note| will be|
|000036a0| 20 72 65 76 69 73 65 64 | 20 74 6f 20 69 6e 64 69 | revised| to indi|
|000036b0| 63 61 74 65 20 69 74 73 | 20 61 76 61 69 6c 61 62 |cate its| availab|
|000036c0| 69 6c 69 74 79 2e 20 20 | 49 66 20 79 6f 75 20 6e |ility. |If you n|
|000036d0| 65 65 64 20 47 65 74 50 | 68 79 73 69 63 61 6c 20 |eed GetP|hysical |
|000036e0| 74 6f 20 6f 70 65 72 61 | 74 65 20 6f 6e 20 52 41 |to opera|te on RA|
|000036f0| 4d 2d 62 61 73 65 64 20 | 76 69 64 65 6f 20 62 75 |M-based |video bu|
|00003700| 66 66 65 72 73 20 6f 72 | 20 79 6f 75 20 6e 65 65 |ffers or| you nee|
|00003710| 64 20 74 6f 20 63 61 6c | 6c 20 47 65 74 50 68 79 |d to cal|l GetPhy|
|00003720| 73 69 63 61 6c 20 61 73 | 20 70 61 72 74 20 6f 66 |sical as| part of|
|00003730| 20 61 20 50 72 69 6d 61 | 72 79 49 6e 69 74 20 6f | a Prima|ryInit o|
|00003740| 72 20 53 43 53 49 20 64 | 72 69 76 65 72 20 69 6e |r SCSI d|river in|
|00003750| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 2c 20 79 6f |itializa|tion, yo|
|00003760| 75 20 73 68 6f 75 6c 64 | 20 62 65 20 63 65 72 74 |u should| be cert|
|00003770| 61 69 6e 20 74 6f 20 74 | 61 6b 65 20 64 65 66 65 |ain to t|ake defe|
|00003780| 6e 73 69 76 65 20 6d 65 | 61 73 75 72 65 73 20 61 |nsive me|asures a|
|00003790| 67 61 69 6e 73 74 20 74 | 68 65 20 73 70 65 63 69 |gainst t|he speci|
|000037a0| 61 6c 20 63 61 73 65 73 | 20 64 65 73 63 72 69 62 |al cases| describ|
|000037b0| 65 64 20 61 62 6f 76 65 | 2e 29 0d 56 4d 20 43 6f |ed above|.).VM Co|
|000037c0| 6d 70 61 74 69 62 69 6c | 69 74 79 0d 43 6f 6d 70 |mpatibil|ity.Comp|
|000037d0| 61 74 69 62 69 6c 69 74 | 79 20 57 69 74 68 20 41 |atibilit|y With A|
|000037e0| 63 63 65 6c 65 72 61 74 | 6f 72 20 55 70 67 72 61 |ccelerat|or Upgra|
|000037f0| 64 65 73 0d 54 68 65 20 | 62 75 72 64 65 6e 20 6f |des.The |burden o|
|00003800| 66 20 63 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 20 |f compat|ibility |
|00003810| 68 61 73 20 6c 6f 6e 67 | 20 62 65 65 6e 20 6f 6e |has long| been on|
|00003820| 20 74 68 65 20 73 68 6f | 75 6c 64 65 72 73 20 6f | the sho|ulders o|
|00003830| 66 20 61 63 63 65 6c 65 | 72 61 74 6f 72 20 6d 61 |f accele|rator ma|
|00003840| 6e 75 66 61 63 74 75 72 | 65 72 73 2e 20 20 56 4d |nufactur|ers. VM|
|00003850| 20 6d 61 79 20 70 72 65 | 73 65 6e 74 20 73 6f 6d | may pre|sent som|
|00003860| 65 20 61 64 64 69 74 69 | 6f 6e 61 6c 20 63 6f 6d |e additi|onal com|
|00003870| 70 61 74 69 62 69 6c 69 | 74 79 20 63 68 61 6c 6c |patibili|ty chall|
|00003880| 65 6e 67 65 73 20 66 6f | 72 20 74 68 65 73 65 20 |enges fo|r these |
|00003890| 6d 61 6e 75 66 61 63 74 | 75 72 65 72 73 2e 0d 56 |manufact|urers..V|
|000038a0| 69 72 74 75 61 6c 20 4d | 65 6d 6f 72 79 20 72 65 |irtual M|emory re|
|000038b0| 71 75 69 72 65 73 20 73 | 65 72 76 69 63 65 73 20 |quires s|ervices |
|000038c0| 77 68 69 63 68 20 61 72 | 65 20 6e 6f 74 20 70 72 |which ar|e not pr|
|000038d0| 65 73 65 6e 74 20 69 6e | 20 74 68 65 20 52 4f 4d |esent in| the ROM|
|000038e0| 73 20 6f 66 20 36 38 30 | 30 30 2d 62 61 73 65 64 |s of 680|00-based|
|000038f0| 20 6d 61 63 68 69 6e 65 | 73 2c 20 73 6f 20 56 4d | machine|s, so VM|
|00003900| 20 69 73 20 6e 6f 74 20 | 73 75 70 70 6f 72 74 65 | is not |supporte|
|00003910| 64 20 62 79 20 74 68 65 | 20 4d 61 63 69 6e 74 6f |d by the| Macinto|
|00003920| 73 68 20 53 45 2c 20 65 | 76 65 6e 20 6f 6e 65 20 |sh SE, e|ven one |
|00003930| 77 69 74 68 20 61 20 36 | 38 30 33 30 20 61 63 63 |with a 6|8030 acc|
|00003940| 65 6c 65 72 61 74 6f 72 | 2e 20 20 54 68 65 20 73 |elerator|. The s|
|00003950| 61 6d 65 20 69 73 20 74 | 72 75 65 20 6f 66 20 74 |ame is t|rue of t|
|00003960| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 20 50 6c 75 |he Macin|tosh Plu|
|00003970| 73 2c 20 74 68 65 20 4d | 61 63 69 6e 74 6f 73 68 |s, the M|acintosh|
|00003980| 20 43 6c 61 73 73 69 63 | 2c 20 61 6e 64 20 74 68 | Classic|, and th|
|00003990| 65 20 4d 61 63 69 6e 74 | 6f 73 68 20 50 6f 72 74 |e Macint|osh Port|
|000039a0| 61 62 6c 65 2e 20 20 54 | 68 65 72 65 20 69 73 20 |able. T|here is |
|000039b0| 6e 6f 20 67 75 61 72 61 | 6e 74 65 65 20 74 68 61 |no guara|ntee tha|
|000039c0| 74 20 74 68 65 73 65 20 | 6f 6c 64 65 72 20 6d 61 |t these |older ma|
|000039d0| 63 68 69 6e 65 73 20 77 | 69 6c 6c 20 65 76 65 72 |chines w|ill ever|
|000039e0| 20 62 65 20 61 62 6c 65 | 20 74 6f 20 73 75 70 70 | be able| to supp|
|000039f0| 6f 72 74 20 56 4d 2e 20 | 20 46 6f 72 20 70 72 61 |ort VM. | For pra|
|00003a00| 63 74 69 63 61 6c 20 72 | 65 61 73 6f 6e 73 2c 20 |ctical r|easons, |
|00003a10| 41 70 70 6c 65 20 68 61 | 73 20 63 68 6f 73 65 6e |Apple ha|s chosen|
|00003a20| 20 6e 6f 74 20 74 6f 20 | 69 6d 70 6c 65 6d 65 6e | not to |implemen|
|00003a30| 74 20 56 4d 20 69 6e 20 | 61 20 77 68 6f 6c 6c 79 |t VM in |a wholly|
|00003a40| 20 52 4f 4d 2d 69 6e 64 | 65 70 65 6e 64 65 6e 74 | ROM-ind|ependent|
|00003a50| 20 6d 61 6e 6e 65 72 2e | 20 20 49 6e 20 74 68 65 | manner.| In the|
|00003a60| 20 66 6f 72 65 73 65 65 | 61 62 6c 65 20 66 75 74 | foresee|able fut|
|00003a70| 75 72 65 2c 20 6f 6e 6c | 79 20 6d 61 63 68 69 6e |ure, onl|y machin|
|00003a80| 65 73 20 69 6e 20 77 68 | 69 63 68 20 41 70 70 6c |es in wh|ich Appl|
|00003a90| 65 20 69 6e 74 65 6e 64 | 65 64 20 74 6f 20 69 6e |e intend|ed to in|
|00003aa0| 63 6c 75 64 65 20 6d 65 | 6d 6f 72 79 20 6d 61 6e |clude me|mory man|
|00003ab0| 61 67 65 6d 65 6e 74 20 | 75 6e 69 74 73 20 63 61 |agement |units ca|
|00003ac0| 6e 20 73 75 70 70 6f 72 | 74 20 56 69 72 74 75 61 |n suppor|t Virtua|
|00003ad0| 6c 20 4d 65 6d 6f 72 79 | 2e 20 20 4d 61 63 68 69 |l Memory|. Machi|
|00003ae0| 6e 65 73 20 6e 65 76 65 | 72 20 69 6e 74 65 6e 64 |nes neve|r intend|
|00003af0| 65 64 20 74 6f 20 69 6e | 63 6c 75 64 65 20 61 6e |ed to in|clude an|
|00003b00| 20 4d 4d 55 20 64 6f 20 | 6e 6f 74 20 68 61 76 65 | MMU do |not have|
|00003b10| 20 61 6c 6c 20 74 68 65 | 20 52 4f 4d 20 63 6f 64 | all the| ROM cod|
|00003b20| 65 20 72 65 71 75 69 72 | 65 64 20 62 79 20 56 4d |e requir|ed by VM|
|00003b30| 2e 0d 56 69 72 74 75 61 | 6c 20 4d 65 6d 6f 72 79 |..Virtua|l Memory|
|00003b40| 20 64 65 70 65 6e 64 73 | 20 6f 6e 20 6c 6f 77 2d | depends| on low-|
|00003b50| 6d 65 6d 6f 72 79 20 67 | 6c 6f 62 61 6c 73 20 74 |memory g|lobals t|
|00003b60| 6f 20 69 6e 64 69 63 61 | 74 65 20 74 68 65 20 70 |o indica|te the p|
|00003b70| 72 65 73 65 6e 63 65 20 | 6f 66 20 61 20 6d 65 6d |resence |of a mem|
|00003b80| 6f 72 79 20 6d 61 6e 61 | 67 65 6d 65 6e 74 20 75 |ory mana|gement u|
|00003b90| 6e 69 74 20 61 74 20 61 | 20 76 65 72 79 20 65 61 |nit at a| very ea|
|00003ba0| 72 6c 79 20 73 74 61 67 | 65 20 6f 66 20 74 68 65 |rly stag|e of the|
|00003bb0| 20 62 6f 6f 74 20 70 72 | 6f 63 65 73 73 2e 20 20 | boot pr|ocess. |
|00003bc0| 49 6e 20 73 6f 6d 65 20 | 63 61 73 65 73 2c 20 74 |In some |cases, t|
|00003bd0| 68 65 20 6c 6f 77 2d 6d | 65 6d 6f 72 79 20 67 6c |he low-m|emory gl|
|00003be0| 6f 62 61 6c 73 20 61 72 | 65 20 6e 6f 74 20 70 72 |obals ar|e not pr|
|00003bf0| 6f 70 65 72 6c 79 20 73 | 65 74 20 62 79 20 74 68 |operly s|et by th|
|00003c00| 65 20 62 6f 6f 74 20 63 | 6f 64 65 20 69 6e 20 52 |e boot c|ode in R|
|00003c10| 4f 4d 20 69 66 20 74 68 | 65 20 68 61 72 64 77 61 |OM if th|e hardwa|
|00003c20| 72 65 20 66 65 61 74 75 | 72 65 73 20 6f 66 20 61 |re featu|res of a|
|00003c30| 6e 20 61 63 63 65 6c 65 | 72 61 74 6f 72 20 61 72 |n accele|rator ar|
|00003c40| 65 20 73 69 67 6e 69 66 | 69 63 61 6e 74 6c 79 20 |e signif|icantly |
|00003c50| 64 69 66 66 65 72 65 6e | 74 20 66 72 6f 6d 20 74 |differen|t from t|
|00003c60| 68 6f 73 65 20 6f 66 20 | 74 68 65 20 73 74 6f 63 |hose of |the stoc|
|00003c70| 6b 20 4d 61 63 69 6e 74 | 6f 73 68 2e 20 20 54 68 |k Macint|osh. Th|
|00003c80| 65 20 6d 6f 73 74 20 6c | 69 6b 65 6c 79 20 70 72 |e most l|ikely pr|
|00003c90| 6f 62 6c 65 6d 73 20 61 | 72 65 20 65 78 68 69 62 |oblems a|re exhib|
|00003ca0| 69 74 65 64 20 62 79 20 | 36 38 30 30 30 20 4d 61 |ited by |68000 Ma|
|00003cb0| 63 69 6e 74 6f 73 68 65 | 73 2c 20 36 38 30 32 30 |cintoshe|s, 68020|
|00003cc0| 20 4d 61 63 69 6e 74 6f | 73 68 65 73 20 77 69 74 | Macinto|shes wit|
|00003cd0| 68 20 36 38 30 33 30 20 | 61 63 63 65 6c 65 72 61 |h 68030 |accelera|
|00003ce0| 74 6f 72 73 2c 20 61 6e | 64 20 4d 61 63 69 6e 74 |tors, an|d Macint|
|00003cf0| 6f 73 68 65 73 20 77 69 | 74 68 20 36 38 30 34 30 |oshes wi|th 68040|
|00003d00| 20 61 63 63 65 6c 65 72 | 61 74 6f 72 73 2e 20 20 | acceler|ators. |
|00003d10| 54 68 65 72 65 20 69 73 | 20 74 68 69 72 64 2d 70 |There is| third-p|
|00003d20| 61 72 74 79 20 76 69 72 | 74 75 61 6c 20 6d 65 6d |arty vir|tual mem|
|00003d30| 6f 72 79 20 73 6f 66 74 | 77 61 72 65 20 77 68 69 |ory soft|ware whi|
|00003d40| 63 68 20 70 72 6f 76 69 | 64 65 73 20 6d 75 63 68 |ch provi|des much|
|00003d50| 20 6f 66 20 74 68 65 20 | 56 4d 20 66 75 6e 63 74 | of the |VM funct|
|00003d60| 69 6f 6e 61 6c 69 74 79 | 20 6f 66 20 53 79 73 74 |ionality| of Syst|
|00003d70| 65 6d 20 53 6f 66 74 77 | 61 72 65 20 37 2e 30 2c |em Softw|are 7.0,|
|00003d80| 20 61 6e 64 20 77 68 69 | 63 68 20 69 73 20 61 6c | and whi|ch is al|
|00003d90| 73 6f 20 63 6f 6d 70 61 | 74 69 62 6c 65 20 77 69 |so compa|tible wi|
|00003da0| 74 68 20 61 63 63 65 6c | 65 72 61 74 6f 72 20 70 |th accel|erator p|
|00003db0| 72 6f 64 75 63 74 73 2e | 20 20 49 6e 20 73 6f 6d |roducts.| In som|
|00003dc0| 65 20 63 61 73 65 73 20 | 74 68 69 73 20 73 6f 66 |e cases |this sof|
|00003dd0| 74 77 61 72 65 20 6d 61 | 79 20 62 65 20 62 75 6e |tware ma|y be bun|
|00003de0| 64 6c 65 64 20 77 69 74 | 68 20 74 68 65 20 61 63 |dled wit|h the ac|
|00003df0| 63 65 6c 65 72 61 74 6f | 72 2e 0d 41 70 70 6c 65 |celerato|r..Apple|
|00003e00| 20 69 73 20 6e 6f 74 20 | 73 61 79 69 6e 67 20 74 | is not |saying t|
|00003e10| 68 61 74 20 56 4d 20 64 | 6f 65 73 20 6e 6f 74 20 |hat VM d|oes not |
|00003e20| 77 6f 72 6b 20 77 69 74 | 68 20 61 6e 79 20 61 63 |work wit|h any ac|
|00003e30| 63 65 6c 65 72 61 74 6f | 72 2c 20 62 75 74 20 72 |celerato|r, but r|
|00003e40| 61 74 68 65 72 20 74 68 | 61 74 20 74 68 65 20 53 |ather th|at the S|
|00003e50| 79 73 74 65 6d 20 37 2e | 30 20 69 6d 70 6c 65 6d |ystem 7.|0 implem|
|00003e60| 65 6e 74 61 74 69 6f 6e | 20 6f 66 20 56 69 72 74 |entation| of Virt|
|00003e70| 75 61 6c 20 4d 65 6d 6f | 72 79 20 69 6e 20 67 65 |ual Memo|ry in ge|
|00003e80| 6e 65 72 61 6c 20 64 6f | 65 73 20 6e 6f 74 20 73 |neral do|es not s|
|00003e90| 75 70 70 6f 72 74 20 61 | 63 63 65 6c 65 72 61 74 |upport a|ccelerat|
|00003ea0| 6f 72 73 2e 20 20 53 6f | 6d 65 20 61 63 63 65 6c |ors. So|me accel|
|00003eb0| 65 72 61 74 6f 72 20 70 | 72 6f 64 75 63 74 73 20 |erator p|roducts |
|00003ec0| 6d 61 79 20 77 6f 72 6b | 20 6f 72 20 6d 61 79 20 |may work| or may |
|00003ed0| 62 65 20 6d 6f 64 69 66 | 69 65 64 20 74 6f 20 77 |be modif|ied to w|
|00003ee0| 6f 72 6b 2e 20 20 41 70 | 70 6c 65 20 73 69 6d 70 |ork. Ap|ple simp|
|00003ef0| 6c 79 20 64 6f 65 73 20 | 6e 6f 74 20 67 75 61 72 |ly does |not guar|
|00003f00| 61 6e 74 65 65 20 74 68 | 61 74 20 61 6e 79 20 70 |antee th|at any p|
|00003f10| 61 72 74 69 63 75 6c 61 | 72 20 61 63 63 65 6c 65 |articula|r accele|
|00003f20| 72 61 74 6f 72 20 70 72 | 6f 64 75 63 74 20 77 6f |rator pr|oduct wo|
|00003f30| 72 6b 73 20 77 69 74 68 | 20 56 4d 2e 0d 43 6f 6d |rks with| VM..Com|
|00003f40| 70 61 74 69 62 69 6c 69 | 74 79 20 57 69 74 68 20 |patibili|ty With |
|00003f50| 52 65 6d 6f 76 61 62 6c | 65 20 4d 65 64 69 61 0d |Removabl|e Media.|
|00003f60| 4f 62 76 69 6f 75 73 6c | 79 20 69 74 20 77 6f 75 |Obviousl|y it wou|
|00003f70| 6c 64 20 62 65 20 61 20 | 64 69 73 61 73 74 65 72 |ld be a |disaster|
|00003f80| 20 69 66 20 61 20 75 73 | 65 72 20 65 6a 65 63 74 | if a us|er eject|
|00003f90| 65 64 20 74 68 65 20 63 | 61 72 74 72 69 64 67 65 |ed the c|artridge|
|00003fa0| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 68 69 73 20 | contain|ing his |
|00003fb0| 62 61 63 6b 69 6e 67 20 | 73 74 6f 72 65 20 28 70 |backing |store (p|
|00003fc0| 61 67 65 64 20 6f 75 74 | 20 6d 65 6d 6f 72 79 29 |aged out| memory)|
|00003fd0| 20 61 6e 64 20 68 61 6e | 64 65 64 20 69 74 20 74 | and han|ded it t|
|00003fe0| 6f 20 61 20 63 6f 77 6f | 72 6b 65 72 20 74 6f 20 |o a cowo|rker to |
|00003ff0| 74 61 6b 65 20 68 6f 6d | 65 2e 20 20 54 68 69 73 |take hom|e. This|
|00004000| 20 77 6f 75 6c 64 20 62 | 65 20 6d 75 63 68 20 77 | would b|e much w|
|00004010| 6f 72 73 65 20 74 68 61 | 6e 20 67 69 76 69 6e 67 |orse tha|n giving|
|00004020| 20 61 77 61 79 20 61 20 | 66 6c 6f 70 70 79 2c 20 | away a |floppy, |
|00004030| 74 6f 20 62 65 20 66 61 | 63 65 64 20 77 69 74 68 |to be fa|ced with|
|00004040| 20 74 68 65 20 d2 50 6c | 65 61 73 65 20 69 6e 73 | the .Pl|ease ins|
|00004050| 65 72 74 20 74 68 65 20 | 64 69 73 6b c9 d3 20 61 |ert the |disk.. a|
|00004060| 6c 65 72 74 2e 20 20 53 | 6f 6d 65 6f 6e 65 20 77 |lert. S|omeone w|
|00004070| 6f 75 6c 64 20 61 63 74 | 75 61 6c 6c 79 20 68 61 |ould act|ually ha|
|00004080| 76 65 20 70 61 72 74 20 | 6f 66 20 74 68 65 20 63 |ve part |of the c|
|00004090| 6f 6d 70 75 74 65 72 d5 | 73 20 6d 65 6d 6f 72 79 |omputer.|s memory|
|000040a0| 20 69 6e 20 68 69 73 20 | 62 72 69 65 66 63 61 73 | in his |briefcas|
|000040b0| 65 d1 74 72 79 20 74 6f | 20 74 79 70 65 20 43 6f |e.try to| type Co|
|000040c0| 6d 6d 61 6e 64 2d 70 65 | 72 69 6f 64 20 61 6e 64 |mmand-pe|riod and|
|000040d0| 20 67 65 74 20 6f 75 74 | 20 6f 66 20 74 68 61 74 | get out| of that|
|000040e0| 20 6f 6e 65 2e 20 20 54 | 6f 20 67 75 61 72 64 20 | one. T|o guard |
|000040f0| 61 67 61 69 6e 73 74 20 | 74 68 69 73 20 70 6f 73 |against |this pos|
|00004100| 73 69 62 69 6c 69 74 79 | 2c 20 65 6a 65 63 74 61 |sibility|, ejecta|
|00004110| 62 6c 65 20 6d 65 64 69 | 61 20 61 72 65 20 6e 6f |ble medi|a are no|
|00004120| 74 20 70 65 72 6d 69 74 | 74 65 64 20 74 6f 20 68 |t permit|ted to h|
|00004130| 6f 73 74 20 74 68 65 20 | 56 4d 20 62 61 63 6b 69 |ost the |VM backi|
|00004140| 6e 67 20 73 74 6f 72 65 | 2e 20 20 55 73 65 72 73 |ng store|. Users|
|00004150| 20 6f 66 20 72 65 6d 6f | 76 61 62 6c 65 20 63 61 | of remo|vable ca|
|00004160| 72 74 72 69 64 67 65 20 | 64 72 69 76 65 73 20 61 |rtridge |drives a|
|00004170| 72 65 20 6e 6f 74 20 77 | 68 6f 6c 6c 79 20 65 78 |re not w|holly ex|
|00004180| 63 6c 75 64 65 64 2c 20 | 68 6f 77 65 76 65 72 2e |cluded, |however.|
|00004190| 20 20 54 68 65 20 64 72 | 69 76 65 72 20 73 6f 66 | The dr|iver sof|
|000041a0| 74 77 61 72 65 20 66 6f | 72 20 73 75 63 68 20 61 |tware fo|r such a|
|000041b0| 20 64 72 69 76 65 20 6d | 61 79 20 69 6d 70 6f 73 | drive m|ay impos|
|000041c0| 65 20 73 6f 66 74 77 61 | 72 65 20 69 6e 74 65 72 |e softwa|re inter|
|000041d0| 6c 6f 63 6b 73 20 74 6f | 20 70 72 65 76 65 6e 74 |locks to| prevent|
|000041e0| 20 65 6a 65 63 74 69 6f | 6e 20 61 6e 64 20 69 6e | ejectio|n and in|
|000041f0| 64 69 63 61 74 65 20 69 | 6e 20 74 68 65 20 64 72 |dicate i|n the dr|
|00004200| 69 76 65 20 71 75 65 75 | 65 20 74 68 61 74 20 74 |ive queu|e that t|
|00004210| 68 65 20 63 61 72 74 72 | 69 64 67 65 20 69 73 20 |he cartr|idge is |
|00004220| 6e 6f 6e 65 6a 65 63 74 | 61 62 6c 65 2e 20 20 56 |noneject|able. V|
|00004230| 4d 20 61 63 63 65 70 74 | 73 20 61 6e 79 20 73 75 |M accept|s any su|
|00004240| 66 66 69 63 69 65 6e 74 | 6c 79 20 6c 61 72 67 65 |fficient|ly large|
|00004250| 2c 20 62 6c 6f 63 6b 20 | 6f 72 69 65 6e 74 65 64 |, block |oriented|
|00004260| 20 64 65 76 69 63 65 20 | 61 73 20 6c 6f 6e 67 20 | device |as long |
|00004270| 61 73 20 69 74 20 69 73 | 20 6e 6f 74 20 65 6a 65 |as it is| not eje|
|00004280| 63 74 61 62 6c 65 2e 0d | 43 6f 6d 70 61 74 69 62 |ctable..|Compatib|
|00004290| 69 6c 69 74 79 20 57 69 | 74 68 20 53 43 53 49 20 |ility Wi|th SCSI |
|000042a0| 43 6f 64 65 0d 56 69 72 | 74 75 61 6c 20 4d 65 6d |Code.Vir|tual Mem|
|000042b0| 6f 72 79 20 69 6e 74 72 | 6f 64 75 63 65 73 20 6e |ory intr|oduces n|
|000042c0| 65 77 20 72 65 71 75 69 | 72 65 6d 65 6e 74 73 20 |ew requi|rements |
|000042d0| 66 6f 72 20 73 6f 6d 65 | 20 53 43 53 49 20 68 61 |for some| SCSI ha|
|000042e0| 72 64 20 64 69 73 6b 20 | 64 72 69 76 65 72 73 2e |rd disk |drivers.|
|000042f0| 20 20 55 73 65 72 73 20 | 6f 66 20 41 70 70 6c 65 | Users |of Apple|
|00004300| 20 68 61 72 64 20 64 69 | 73 6b 73 20 6d 61 79 20 | hard di|sks may |
|00004310| 6e 65 65 64 20 74 6f 20 | 75 70 64 61 74 65 20 74 |need to |update t|
|00004320| 68 65 69 72 20 64 72 69 | 76 65 72 73 20 77 69 74 |heir dri|vers wit|
|00004330| 68 20 61 20 53 79 73 74 | 65 6d 20 53 6f 66 74 77 |h a Syst|em Softw|
|00004340| 61 72 65 20 37 2e 30 d0 | 63 6f 6d 70 61 74 69 62 |are 7.0.|compatib|
|00004350| 6c 65 20 41 70 70 6c 65 | 20 48 44 20 53 43 20 53 |le Apple| HD SC S|
|00004360| 65 74 75 70 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |etup app|lication|
|00004370| 2e 20 20 54 68 69 72 64 | 2d 70 61 72 74 79 20 68 |. Third|-party h|
|00004380| 61 72 64 20 64 69 73 6b | 20 64 72 69 76 65 72 73 |ard disk| drivers|
|00004390| 20 6d 61 79 20 61 6c 73 | 6f 20 6e 65 65 64 20 74 | may als|o need t|
|000043a0| 6f 20 62 65 20 75 70 64 | 61 74 65 64 2e 20 20 49 |o be upd|ated. I|
|000043b0| 74 20 69 73 20 75 70 20 | 74 6f 20 74 68 65 73 65 |t is up |to these|
|000043c0| 20 74 68 69 72 64 20 70 | 61 72 74 69 65 73 20 74 | third p|arties t|
|000043d0| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 77 68 61 74 |o determ|ine what|
|000043e0| 20 65 6e 68 61 6e 63 65 | 6d 65 6e 74 73 2c 20 69 | enhance|ments, i|
|000043f0| 66 20 61 6e 79 2c 20 61 | 72 65 20 72 65 71 75 69 |f any, a|re requi|
|00004400| 72 65 64 20 66 6f 72 20 | 74 68 65 69 72 20 64 72 |red for |their dr|
|00004410| 69 76 65 72 73 20 61 6e | 64 20 74 6f 20 70 72 6f |ivers an|d to pro|
|00004420| 76 69 64 65 20 75 70 64 | 61 74 65 73 20 74 6f 20 |vide upd|ates to |
|00004430| 74 68 65 69 72 20 63 75 | 73 74 6f 6d 65 72 73 20 |their cu|stomers |
|00004440| 69 66 20 6e 65 63 65 73 | 73 61 72 79 2e 0d 46 6f |if neces|sary..Fo|
|00004450| 72 20 53 43 53 49 20 64 | 69 73 6b 20 64 72 69 76 |r SCSI d|isk driv|
|00004460| 65 72 20 64 65 76 65 6c | 6f 70 65 72 73 2c 20 6f |er devel|opers, o|
|00004470| 6e 65 20 72 65 71 75 69 | 72 65 6d 65 6e 74 20 66 |ne requi|rement f|
|00004480| 6f 72 20 56 4d 20 63 6f | 6d 70 61 74 69 62 69 6c |or VM co|mpatibil|
|00004490| 69 74 79 20 6d 61 79 20 | 62 65 20 73 75 6d 6d 61 |ity may |be summa|
|000044a0| 72 69 7a 65 64 20 61 73 | 20 66 6f 6c 6c 6f 77 73 |rized as| follows|
|000044b0| 20 28 73 70 65 63 69 61 | 6c 20 74 68 61 6e 6b 73 | (specia|l thanks|
|000044c0| 20 74 6f 20 41 6e 64 79 | 20 47 6f 6e 67 20 66 6f | to Andy| Gong fo|
|000044d0| 72 20 74 68 65 20 64 65 | 74 61 69 6c 65 64 20 61 |r the de|tailed a|
|000044e0| 6e 61 6c 79 73 69 73 29 | 3a 0d 4f 6e 20 53 79 73 |nalysis)|:.On Sys|
|000044f0| 74 65 6d 20 36 2e 30 2e | 78 20 61 6e 64 20 65 61 |tem 6.0.|x and ea|
|00004500| 72 6c 69 65 72 2c 20 61 | 6c 6c 20 63 61 6c 6c 73 |rlier, a|ll calls|
|00004510| 20 74 6f 20 74 68 65 20 | 53 43 53 49 20 64 69 73 | to the |SCSI dis|
|00004520| 6b 20 64 72 69 76 65 72 | 20 63 61 6d 65 20 66 72 |k driver| came fr|
|00004530| 6f 6d 20 74 68 65 20 66 | 69 6c 65 20 73 79 73 74 |om the f|ile syst|
|00004540| 65 6d 2e 20 20 54 68 69 | 73 20 62 65 69 6e 67 20 |em. Thi|s being |
|00004550| 74 72 75 65 2c 20 61 6e | 64 20 74 68 65 20 66 69 |true, an|d the fi|
|00004560| 6c 65 20 73 79 73 74 65 | 6d 20 62 65 69 6e 67 20 |le syste|m being |
|00004570| 73 69 6e 67 6c 65 2d 74 | 68 72 65 61 64 65 64 2c |single-t|hreaded,|
|00004580| 20 6f 6e 6c 79 20 6f 6e | 65 20 53 43 53 49 20 64 | only on|e SCSI d|
|00004590| 69 73 6b 20 64 72 69 76 | 65 72 20 77 6f 75 6c 64 |isk driv|er would|
|000045a0| 20 62 65 20 63 61 6c 6c | 65 64 20 61 74 20 61 6e | be call|ed at an|
|000045b0| 79 20 6f 6e 65 20 74 69 | 6d 65 2e 20 20 56 69 72 |y one ti|me. Vir|
|000045c0| 74 75 61 6c 20 4d 65 6d | 6f 72 79 20 63 68 61 6e |tual Mem|ory chan|
|000045d0| 67 65 73 20 74 68 69 73 | 20 73 63 65 6e 61 72 69 |ges this| scenari|
|000045e0| 6f 20 62 65 63 61 75 73 | 65 20 69 74 20 6d 61 6b |o becaus|e it mak|
|000045f0| 65 73 20 63 61 6c 6c 73 | 20 74 6f 20 74 68 65 20 |es calls| to the |
|00004600| 64 72 69 76 65 72 20 64 | 69 72 65 63 74 6c 79 2c |driver d|irectly,|
|00004610| 20 61 76 6f 69 64 69 6e | 67 20 74 68 65 20 66 69 | avoidin|g the fi|
|00004620| 6c 65 20 73 79 73 74 65 | 6d 2e 20 20 54 68 69 73 |le syste|m. This|
|00004630| 20 69 6d 70 6c 69 65 73 | 20 74 68 65 20 70 6f 73 | implies| the pos|
|00004640| 73 69 62 69 6c 69 74 79 | 20 6f 66 20 53 43 53 49 |sibility| of SCSI|
|00004650| 20 64 72 69 76 65 72 73 | 20 62 65 69 6e 67 20 72 | drivers| being r|
|00004660| 65 65 6e 74 65 72 65 64 | 2e 0d 46 6f 72 20 61 20 |eentered|..For a |
|00004670| 53 43 53 49 20 64 72 69 | 76 65 72 20 74 6f 20 66 |SCSI dri|ver to f|
|00004680| 75 6e 63 74 69 6f 6e 20 | 63 6f 72 72 65 63 74 6c |unction |correctl|
|00004690| 79 20 69 6e 20 74 68 65 | 20 56 4d 20 65 6e 76 69 |y in the| VM envi|
|000046a0| 72 6f 6e 6d 65 6e 74 2c | 20 74 68 65 20 64 72 69 |ronment,| the dri|
|000046b0| 76 65 72 20 6d 75 73 74 | 20 68 61 76 65 20 63 6f |ver must| have co|
|000046c0| 6d 70 6c 65 74 65 20 64 | 72 69 76 65 72 20 64 61 |mplete d|river da|
|000046d0| 74 61 20 73 65 70 61 72 | 61 74 69 6f 6e 20 61 74 |ta separ|ation at|
|000046e0| 20 6c 65 61 73 74 20 6f | 6e 20 61 20 64 72 69 76 | least o|n a driv|
|000046f0| 65 2d 62 79 2d 64 72 69 | 76 65 20 62 61 73 69 73 |e-by-dri|ve basis|
|00004700| 2e 20 20 53 75 63 68 20 | 73 65 70 61 72 61 74 69 |. Such |separati|
|00004710| 6f 6e 20 6d 61 6b 65 73 | 20 74 68 65 20 64 72 69 |on makes| the dri|
|00004720| 76 65 72 20 72 65 65 6e | 74 72 61 6e 74 20 6f 6e |ver reen|trant on|
|00004730| 20 61 20 64 72 69 76 65 | 2d 62 79 2d 64 72 69 76 | a drive|-by-driv|
|00004740| 65 20 62 61 73 69 73 2e | 20 20 49 66 20 74 68 65 |e basis.| If the|
|00004750| 20 64 72 69 76 65 72 20 | 73 75 70 70 6f 72 74 73 | driver |supports|
|00004760| 20 6d 75 6c 74 69 70 6c | 65 20 48 46 53 20 70 61 | multipl|e HFS pa|
|00004770| 72 74 69 74 69 6f 6e 73 | 20 6f 6e 20 74 68 65 20 |rtitions| on the |
|00004780| 73 61 6d 65 20 70 68 79 | 73 69 63 61 6c 20 64 72 |same phy|sical dr|
|00004790| 69 76 65 2c 20 74 68 65 | 20 64 72 69 76 65 72 20 |ive, the| driver |
|000047a0| 6d 75 73 74 20 62 65 20 | 63 6f 6d 70 6c 65 74 65 |must be |complete|
|000047b0| 6c 79 20 72 65 65 6e 74 | 72 61 6e 74 20 69 66 20 |ly reent|rant if |
|000047c0| 61 6e 79 20 6f 66 20 74 | 68 65 20 48 46 53 20 70 |any of t|he HFS p|
|000047d0| 61 72 74 69 74 69 6f 6e | 73 20 61 72 65 20 74 6f |artition|s are to|
|000047e0| 20 62 65 20 75 73 65 64 | 20 66 6f 72 20 74 68 65 | be used| for the|
|000047f0| 20 56 4d 20 62 61 63 6b | 69 6e 67 20 66 69 6c 65 | VM back|ing file|
|00004800| 2e 0d 41 6c 6c 20 74 68 | 69 73 20 6d 65 61 6e 73 |..All th|is means|
|00004810| 20 69 73 20 74 68 61 74 | 20 61 20 64 72 69 76 65 | is that| a drive|
|00004820| 72 20 77 68 69 63 68 20 | 63 6f 6e 74 72 6f 6c 73 |r which |controls|
|00004830| 20 6d 75 6c 74 69 70 6c | 65 20 64 72 69 76 65 73 | multipl|e drives|
|00004840| 20 6f 72 20 70 61 72 74 | 69 74 69 6f 6e 73 20 6d | or part|itions m|
|00004850| 75 73 74 20 6d 61 69 6e | 74 61 69 6e 20 73 65 70 |ust main|tain sep|
|00004860| 61 72 61 74 65 20 64 72 | 69 76 65 72 20 76 61 72 |arate dr|iver var|
|00004870| 69 61 62 6c 65 73 20 74 | 6f 20 72 65 66 65 72 65 |iables t|o refere|
|00004880| 6e 63 65 20 65 61 63 68 | 20 64 72 69 76 65 20 6f |nce each| drive o|
|00004890| 72 20 70 61 72 74 69 74 | 69 6f 6e 2e 20 20 4f 74 |r partit|ion. Ot|
|000048a0| 68 65 72 77 69 73 65 2c | 20 74 68 65 20 73 74 61 |herwise,| the sta|
|000048b0| 74 65 20 6f 66 20 61 20 | 74 72 61 6e 73 61 63 74 |te of a |transact|
|000048c0| 69 6f 6e 20 74 6f 20 6f | 6e 65 20 64 72 69 76 65 |ion to o|ne drive|
|000048d0| 20 6d 61 79 20 62 65 20 | 6c 6f 73 74 20 77 68 65 | may be |lost whe|
|000048e0| 6e 20 74 68 65 20 64 72 | 69 76 65 72 20 69 73 20 |n the dr|iver is |
|000048f0| 72 65 65 6e 74 65 72 65 | 64 20 74 6f 20 73 65 72 |reentere|d to ser|
|00004900| 76 69 63 65 20 61 6e 6f | 74 68 65 72 20 64 72 69 |vice ano|ther dri|
|00004910| 76 65 2e 20 20 54 68 65 | 72 65 20 69 73 20 6e 6f |ve. The|re is no|
|00004920| 20 70 72 6f 62 6c 65 6d | 20 77 69 74 68 20 72 65 | problem| with re|
|00004930| 65 6e 74 72 61 6e 63 79 | 20 66 6f 72 20 64 72 69 |entrancy| for dri|
|00004940| 76 65 72 73 20 77 68 69 | 63 68 20 63 6f 6e 74 72 |vers whi|ch contr|
|00004950| 6f 6c 20 6f 6e 6c 79 20 | 61 20 73 69 6e 67 6c 65 |ol only |a single|
|00004960| 20 64 72 69 76 65 20 6f | 72 20 70 61 72 74 69 74 | drive o|r partit|
|00004970| 69 6f 6e 2e 0d 49 6e 20 | 6d 61 6e 79 20 63 61 73 |ion..In |many cas|
|00004980| 65 73 20 6f 66 20 53 43 | 53 49 20 63 6f 64 65 20 |es of SC|SI code |
|00004990| 69 6e 63 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 2c |incompat|ibility,|
|000049a0| 20 72 65 65 6e 74 72 61 | 6e 63 79 20 69 73 20 6e | reentra|ncy is n|
|000049b0| 6f 74 20 74 68 65 20 70 | 72 6f 62 6c 65 6d 2e 20 |ot the p|roblem. |
|000049c0| 20 54 68 69 73 20 61 66 | 66 65 63 74 73 20 6f 6e | This af|fects on|
|000049d0| 6c 79 20 74 68 65 20 73 | 6d 61 6c 6c 20 6e 75 6d |ly the s|mall num|
|000049e0| 62 65 72 20 6f 66 20 53 | 43 53 49 20 64 69 73 6b |ber of S|CSI disk|
|000049f0| 20 64 72 69 76 65 72 73 | 20 77 68 69 63 68 20 61 | drivers| which a|
|00004a00| 72 65 20 64 65 73 69 67 | 6e 65 64 20 74 6f 20 63 |re desig|ned to c|
|00004a10| 6f 6e 74 72 6f 6c 20 6d | 75 6c 74 69 70 6c 65 20 |ontrol m|ultiple |
|00004a20| 64 72 69 76 65 73 20 6f | 72 20 70 61 72 74 69 74 |drives o|r partit|
|00004a30| 69 6f 6e 73 20 66 72 6f | 6d 20 61 20 73 69 6e 67 |ions fro|m a sing|
|00004a40| 6c 65 20 64 72 69 76 65 | 72 2e 20 20 41 20 6d 6f |le drive|r. A mo|
|00004a50| 72 65 20 63 6f 6d 6d 6f | 6e 20 70 72 6f 62 6c 65 |re commo|n proble|
|00004a60| 6d 20 69 73 20 63 61 75 | 73 65 64 20 62 79 20 61 |m is cau|sed by a|
|00004a70| 20 70 61 67 65 20 66 61 | 75 6c 74 20 77 68 69 6c | page fa|ult whil|
|00004a80| 65 20 74 68 65 20 53 43 | 53 49 20 62 75 73 20 69 |e the SC|SI bus i|
|00004a90| 73 20 62 75 73 79 2e 20 | 20 53 69 6e 63 65 20 56 |s busy. | Since V|
|00004aa0| 4d 20 64 65 70 65 6e 64 | 73 20 6f 6e 20 74 68 65 |M depend|s on the|
|00004ab0| 20 53 43 53 49 20 62 75 | 73 20 74 6f 20 68 61 6e | SCSI bu|s to han|
|00004ac0| 64 6c 65 20 61 20 70 61 | 67 65 20 66 61 75 6c 74 |dle a pa|ge fault|
|00004ad0| 2c 20 61 20 70 61 67 65 | 20 66 61 75 6c 74 20 69 |, a page| fault i|
|00004ae0| 73 20 66 6f 72 62 69 64 | 64 65 6e 20 74 6f 20 68 |s forbid|den to h|
|00004af0| 61 70 70 65 6e 20 77 68 | 69 6c 65 20 74 68 65 20 |appen wh|ile the |
|00004b00| 53 43 53 49 20 62 75 73 | 20 69 73 20 62 75 73 79 |SCSI bus| is busy|
|00004b10| 2e 20 43 6f 64 65 20 77 | 68 69 63 68 20 75 73 65 |. Code w|hich use|
|00004b20| 73 20 74 68 65 20 53 43 | 53 49 20 4d 61 6e 61 67 |s the SC|SI Manag|
|00004b30| 65 72 20 6e 65 65 64 73 | 20 69 6e 20 67 65 6e 65 |er needs| in gene|
|00004b40| 72 61 6c 20 74 6f 20 65 | 6e 73 75 72 65 20 74 68 |ral to e|nsure th|
|00004b50| 61 74 20 61 6c 6c 20 69 | 74 73 20 63 6f 64 65 2c |at all i|ts code,|
|00004b60| 20 62 75 66 66 65 72 73 | 2c 20 61 6e 64 20 64 61 | buffers|, and da|
|00004b70| 74 61 20 73 74 72 75 63 | 74 75 72 65 73 20 28 69 |ta struc|tures (i|
|00004b80| 6e 63 6c 75 64 69 6e 67 | 20 54 49 42 73 29 20 61 |ncluding| TIBs) a|
|00004b90| 72 65 20 68 65 6c 64 20 | 69 6e 20 72 65 61 6c 20 |re held |in real |
|00004ba0| 6d 65 6d 6f 72 79 20 62 | 65 66 6f 72 65 20 74 61 |memory b|efore ta|
|00004bb0| 6b 69 6e 67 20 63 6f 6e | 74 72 6f 6c 20 6f 66 20 |king con|trol of |
|00004bc0| 74 68 65 20 62 75 73 2e | 0d 49 6e 20 74 68 65 20 |the bus.|.In the |
|00004bd0| 6e 6f 72 6d 61 6c 20 63 | 6f 75 72 73 65 20 6f 66 |normal c|ourse of|
|00004be0| 20 65 76 65 6e 74 73 2c | 20 74 68 65 20 73 79 73 | events,| the sys|
|00004bf0| 74 65 6d 20 68 65 61 70 | 20 69 73 20 68 65 6c 64 |tem heap| is held|
|00004c00| 20 69 6e 20 72 65 61 6c | 20 6d 65 6d 6f 72 79 2e | in real| memory.|
|00004c10| 20 4f 74 68 65 72 20 63 | 72 69 74 69 63 61 6c 20 | Other c|ritical |
|00004c20| 73 74 72 75 63 74 75 72 | 65 73 20 61 72 65 20 68 |structur|es are h|
|00004c30| 65 6c 64 20 66 6f 72 20 | 79 6f 75 20 61 75 74 6f |eld for |you auto|
|00004c40| 6d 61 74 69 63 61 6c 6c | 79 2c 20 6c 69 6b 65 20 |maticall|y, like |
|00004c50| 61 6e 79 20 72 61 6e 67 | 65 20 6f 66 20 6d 65 6d |any rang|e of mem|
|00004c60| 6f 72 79 20 70 61 73 73 | 65 64 20 74 6f 20 61 20 |ory pass|ed to a |
|00004c70| 44 65 76 69 63 65 20 4d | 61 6e 61 67 65 72 20 5f |Device M|anager _|
|00004c80| 52 65 61 64 20 6f 72 20 | 5f 57 72 69 74 65 20 63 |Read or |_Write c|
|00004c90| 61 6c 6c 20 69 6e 20 69 | 6f 42 75 66 66 65 72 20 |all in i|oBuffer |
|00004ca0| 61 6e 64 20 69 6f 52 65 | 71 43 6f 75 6e 74 2e 20 |and ioRe|qCount. |
|00004cb0| 53 6f 20 69 66 20 79 6f | 75 72 20 53 43 53 49 20 |So if yo|ur SCSI |
|00004cc0| 63 6f 64 65 20 69 73 20 | 77 72 69 74 74 65 6e 20 |code is |written |
|00004cd0| 61 73 20 61 20 64 65 76 | 69 63 65 20 64 72 69 76 |as a dev|ice driv|
|00004ce0| 65 72 2c 20 61 6e 64 20 | 74 68 65 20 62 75 66 66 |er, and |the buff|
|00004cf0| 65 72 d5 73 20 61 64 64 | 72 65 73 73 20 61 6e 64 |er.s add|ress and|
|00004d00| 20 6c 65 6e 67 74 68 20 | 61 72 65 20 70 61 73 73 | length |are pass|
|00004d10| 65 64 20 69 6e 20 74 68 | 65 20 6e 6f 72 6d 61 6c |ed in th|e normal|
|00004d20| 20 64 72 69 76 65 72 20 | 66 61 73 68 69 6f 6e 2c | driver |fashion,|
|00004d30| 20 61 6e 64 20 69 66 20 | 79 6f 75 72 20 64 72 69 | and if |your dri|
|00004d40| 76 65 72 20 63 6f 64 65 | 20 61 6e 64 20 64 61 74 |ver code| and dat|
|00004d50| 61 20 73 74 72 75 63 74 | 75 72 65 73 20 61 72 65 |a struct|ures are|
|00004d60| 20 6c 6f 63 61 74 65 64 | 20 69 6e 20 74 68 65 20 | located| in the |
|00004d70| 73 79 73 74 65 6d 20 68 | 65 61 70 2c 20 79 6f 75 |system h|eap, you|
|00004d80| 20 73 68 6f 75 6c 64 20 | 62 65 20 66 75 6c 6c 79 | should |be fully|
|00004d90| 20 56 4d 2d 63 6f 6d 70 | 61 74 69 62 6c 65 20 61 | VM-comp|atible a|
|00004da0| 6c 72 65 61 64 79 20 28 | 61 73 20 6c 6f 6e 67 20 |lready (|as long |
|00004db0| 61 73 20 79 6f 75 20 6f | 6e 6c 79 20 6f 70 65 72 |as you o|nly oper|
|00004dc0| 61 74 65 20 6f 6e 20 6f | 6e 65 20 64 72 69 76 65 |ate on o|ne drive|
|00004dd0| 20 70 65 72 20 64 72 69 | 76 65 72 29 2e 0d 49 66 | per dri|ver)..If|
|00004de0| 20 79 6f 75 72 20 53 43 | 53 49 20 63 6f 64 65 20 | your SC|SI code |
|00004df0| 69 73 20 6e 6f 74 20 61 | 20 73 74 61 6e 64 61 72 |is not a| standar|
|00004e00| 64 20 44 65 76 69 63 65 | 20 4d 61 6e 61 67 65 72 |d Device| Manager|
|00004e10| 20 64 72 69 76 65 72 20 | 6f 72 20 69 66 20 79 6f | driver |or if yo|
|00004e20| 75 20 72 65 66 65 72 65 | 6e 63 65 20 62 75 66 66 |u refere|nce buff|
|00004e30| 65 72 73 20 61 73 20 63 | 73 50 61 72 61 6d 73 20 |ers as c|sParams |
|00004e40| 74 6f 20 5f 43 6f 6e 74 | 72 6f 6c 20 6f 72 20 5f |to _Cont|rol or _|
|00004e50| 53 74 61 74 75 73 20 63 | 61 6c 6c 73 2c 20 79 6f |Status c|alls, yo|
|00004e60| 75 27 6c 6c 20 6e 65 65 | 64 20 74 6f 20 64 6f 20 |u'll nee|d to do |
|00004e70| 73 6f 6d 65 20 65 78 74 | 72 61 20 77 6f 72 6b 2e |some ext|ra work.|
|00004e80| 20 41 6c 73 6f 2c 20 41 | 70 70 6c 65 20 64 6f 65 | Also, A|pple doe|
|00004e90| 73 20 6e 6f 74 20 67 75 | 61 72 61 6e 74 65 65 20 |s not gu|arantee |
|00004ea0| 74 68 61 74 20 74 68 65 | 20 73 79 73 74 65 6d 20 |that the| system |
|00004eb0| 68 65 61 70 20 77 69 6c | 6c 20 61 6c 77 61 79 73 |heap wil|l always|
|00004ec0| 20 62 65 20 68 65 6c 64 | 20 66 6f 72 20 65 76 65 | be held| for eve|
|00004ed0| 72 20 61 6e 64 20 65 76 | 65 72 2c 20 73 6f 20 69 |r and ev|er, so i|
|00004ee0| 66 20 79 6f 75 20 63 6f | 6d 65 20 74 6f 20 72 65 |f you co|me to re|
|00004ef0| 76 69 73 65 20 79 6f 75 | 72 20 64 72 69 76 65 72 |vise you|r driver|
|00004f00| 20 79 6f 75 20 73 68 6f | 75 6c 64 20 73 65 72 69 | you sho|uld seri|
|00004f10| 6f 75 73 6c 79 20 63 6f | 6e 73 69 64 65 72 20 68 |ously co|nsider h|
|00004f20| 6f 6c 64 69 6e 67 20 65 | 78 70 6c 69 63 69 74 6c |olding e|xplicitl|
|00004f30| 79 20 65 76 65 72 79 74 | 68 69 6e 67 20 79 6f 75 |y everyt|hing you|
|00004f40| 20 74 6f 75 63 68 20 77 | 68 69 6c 65 20 79 6f 75 | touch w|hile you|
|00004f50| 20 6f 77 6e 20 74 68 65 | 20 53 43 53 49 20 62 75 | own the| SCSI bu|
|00004f60| 73 20 61 6e 64 20 65 76 | 65 72 79 74 68 69 6e 67 |s and ev|erything|
|00004f70| 20 79 6f 75 20 6d 69 67 | 68 74 20 6b 6e 6f 77 69 | you mig|ht knowi|
|00004f80| 6e 67 6c 79 20 74 6f 75 | 63 68 20 61 74 20 69 6e |ngly tou|ch at in|
|00004f90| 74 65 72 72 75 70 74 20 | 74 69 6d 65 3b 20 61 6e |terrupt |time; an|
|00004fa0| 64 20 6f 66 20 63 6f 75 | 72 73 65 20 79 6f 75 20 |d of cou|rse you |
|00004fb0| 73 68 6f 75 6c 64 20 63 | 6f 72 72 65 73 70 6f 6e |should c|orrespon|
|00004fc0| 64 69 6e 67 6c 79 20 75 | 6e 68 6f 6c 64 20 61 6c |dingly u|nhold al|
|00004fd0| 6c 20 74 68 65 73 65 20 | 73 74 72 75 63 74 75 72 |l these |structur|
|00004fe0| 65 73 20 75 70 6f 6e 20 | 72 65 6c 65 61 73 69 6e |es upon |releasin|
|00004ff0| 67 20 74 68 65 20 62 75 | 73 2e 20 20 42 65 20 61 |g the bu|s. Be a|
|00005000| 20 67 6f 6f 64 20 63 69 | 74 69 7a 65 6e 2e 0d 49 | good ci|tizen..I|
|00005010| 6e 20 61 64 64 69 74 69 | 6f 6e 20 74 6f 20 74 68 |n additi|on to th|
|00005020| 65 20 72 65 71 75 69 72 | 65 6d 65 6e 74 20 66 6f |e requir|ement fo|
|00005030| 72 20 72 65 65 6e 74 72 | 61 6e 63 79 20 61 63 72 |r reentr|ancy acr|
|00005040| 6f 73 73 20 64 72 69 76 | 65 73 20 73 65 72 76 65 |oss driv|es serve|
|00005050| 64 20 62 79 20 61 20 73 | 69 6e 67 6c 65 20 64 72 |d by a s|ingle dr|
|00005060| 69 76 65 72 2c 20 74 68 | 65 20 64 72 69 76 65 72 |iver, th|e driver|
|00005070| 20 66 6f 72 20 61 20 64 | 69 73 6b 20 75 73 65 64 | for a d|isk used|
|00005080| 20 61 73 20 61 20 62 61 | 63 6b 69 6e 67 20 73 74 | as a ba|cking st|
|00005090| 6f 72 65 20 6d 75 73 74 | 20 6c 6f 61 64 20 61 74 |ore must| load at|
|000050a0| 20 74 68 65 20 65 61 72 | 6c 69 65 73 74 20 70 6f | the ear|liest po|
|000050b0| 73 73 69 62 6c 65 20 6f | 70 70 6f 72 74 75 6e 69 |ssible o|pportuni|
|000050c0| 74 79 2e 20 20 44 72 69 | 76 65 72 73 20 77 68 69 |ty. Dri|vers whi|
|000050d0| 63 68 20 64 65 66 65 72 | 20 69 6e 73 74 61 6c 6c |ch defer| install|
|000050e0| 61 74 69 6f 6e 20 75 6e | 74 69 6c 20 49 4e 49 54 |ation un|til INIT|
|000050f0| 20 74 69 6d 65 20 61 72 | 65 20 74 6f 6f 20 6c 61 | time ar|e too la|
|00005100| 74 65 20 74 6f 20 62 65 | 20 75 73 65 64 20 62 79 |te to be| used by|
|00005110| 20 56 4d 2e 0d 43 6f 6d | 70 61 74 69 62 69 6c 69 | VM..Com|patibili|
|00005120| 74 79 20 57 69 74 68 20 | 4f 74 68 65 72 20 44 65 |ty With |Other De|
|00005130| 76 69 63 65 20 44 72 69 | 76 65 72 73 20 61 6e 64 |vice Dri|vers and|
|00005140| 20 49 6e 74 65 72 72 75 | 70 74 2d 4c 65 76 65 6c | Interru|pt-Level|
|00005150| 20 43 6f 64 65 0d 54 68 | 65 20 70 72 69 6d 61 72 | Code.Th|e primar|
|00005160| 79 20 63 6f 6e 63 65 72 | 6e 20 66 6f 72 20 64 65 |y concer|n for de|
|00005170| 76 69 63 65 20 64 72 69 | 76 65 72 73 20 69 73 20 |vice dri|vers is |
|00005180| 74 68 61 74 20 74 68 65 | 79 20 63 6f 6d 6d 6f 6e |that the|y common|
|00005190| 6c 79 20 72 75 6e 20 61 | 74 20 69 6e 74 65 72 72 |ly run a|t interr|
|000051a0| 75 70 74 20 74 69 6d 65 | 20 61 6e 64 20 69 74 20 |upt time| and it |
|000051b0| 69 73 20 61 62 73 6f 6c | 75 74 65 6c 79 20 65 73 |is absol|utely es|
|000051c0| 73 65 6e 74 69 61 6c 20 | 74 68 61 74 20 69 6e 74 |sential |that int|
|000051d0| 65 72 72 75 70 74 2d 6c | 65 76 65 6c 20 63 6f 64 |errupt-l|evel cod|
|000051e0| 65 20 64 6f 65 73 20 6e | 6f 74 20 63 61 75 73 65 |e does n|ot cause|
|000051f0| 20 61 20 70 61 67 65 20 | 66 61 75 6c 74 2e 20 20 | a page |fault. |
|00005200| 54 6f 20 61 76 6f 69 64 | 20 74 68 69 73 2c 20 64 |To avoid| this, d|
|00005210| 72 69 76 65 72 73 20 73 | 68 6f 75 6c 64 20 6d 61 |rivers s|hould ma|
|00005220| 6b 65 20 63 65 72 74 61 | 69 6e 20 74 68 61 74 20 |ke certa|in that |
|00005230| 61 6e 79 20 64 61 74 61 | 20 73 74 72 75 63 74 75 |any data| structu|
|00005240| 72 65 73 20 74 68 65 79 | 20 6b 65 65 70 20 6f 72 |res they| keep or|
|00005250| 20 72 65 66 65 72 65 6e | 63 65 20 61 74 20 69 6e | referen|ce at in|
|00005260| 74 65 72 72 75 70 74 20 | 74 69 6d 65 20 61 72 65 |terrupt |time are|
|00005270| 20 68 65 6c 64 20 69 6e | 20 70 68 79 73 69 63 61 | held in| physica|
|00005280| 6c 20 6d 65 6d 6f 72 79 | 20 61 73 20 64 65 73 63 |l memory| as desc|
|00005290| 72 69 62 65 64 20 65 61 | 72 6c 69 65 72 2e 20 20 |ribed ea|rlier. |
|000052a0| 4c 6f 63 6b 69 6e 67 20 | 74 68 65 20 73 74 72 75 |Locking |the stru|
|000052b0| 63 74 75 72 65 73 20 69 | 73 20 74 79 70 69 63 61 |ctures i|s typica|
|000052c0| 6c 6c 79 20 6e 6f 74 20 | 6e 65 63 65 73 73 61 72 |lly not |necessar|
|000052d0| 79 20 65 78 63 65 70 74 | 20 69 6e 20 63 61 73 65 |y except| in case|
|000052e0| 73 20 77 68 65 72 65 20 | 61 6c 74 65 72 6e 61 74 |s where |alternat|
|000052f0| 65 20 62 75 73 20 6d 61 | 73 74 65 72 20 68 61 72 |e bus ma|ster har|
|00005300| 64 77 61 72 65 20 61 63 | 63 65 73 73 65 73 20 74 |dware ac|cesses t|
|00005310| 68 6f 73 65 20 73 74 72 | 75 63 74 75 72 65 73 20 |hose str|uctures |
|00005320| 61 73 20 77 65 6c 6c 2e | 0d 54 6f 20 69 6d 70 72 |as well.|.To impr|
|00005330| 6f 76 65 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |ove perf|ormance |
|00005340| 61 6e 64 20 63 6f 6d 70 | 61 74 69 62 69 6c 69 74 |and comp|atibilit|
|00005350| 79 20 77 69 74 68 20 65 | 78 69 73 74 69 6e 67 20 |y with e|xisting |
|00005360| 73 6f 66 74 77 61 72 65 | 20 61 6e 64 20 64 72 69 |software| and dri|
|00005370| 76 65 72 73 2c 20 74 68 | 65 20 66 69 72 73 74 20 |vers, th|e first |
|00005380| 72 65 6c 65 61 73 65 20 | 6f 66 20 53 79 73 74 65 |release |of Syste|
|00005390| 6d 20 53 6f 66 74 77 61 | 72 65 20 37 2e 30 20 61 |m Softwa|re 7.0 a|
|000053a0| 6c 77 61 79 73 20 68 6f | 6c 64 73 20 74 68 65 20 |lways ho|lds the |
|000053b0| 65 6e 74 69 72 65 20 73 | 79 73 74 65 6d 20 68 65 |entire s|ystem he|
|000053c0| 61 70 20 69 6e 20 70 68 | 79 73 69 63 61 6c 20 6d |ap in ph|ysical m|
|000053d0| 65 6d 6f 72 79 2e 20 20 | 4e 6f 20 73 70 65 63 69 |emory. |No speci|
|000053e0| 61 6c 20 6d 65 61 73 75 | 72 65 73 20 6e 65 65 64 |al measu|res need|
|000053f0| 20 62 65 20 74 61 6b 65 | 6e 20 69 66 20 79 6f 75 | be take|n if you|
|00005400| 72 20 64 72 69 76 65 72 | 20 61 6e 64 20 69 74 73 |r driver| and its|
|00005410| 20 61 73 73 6f 63 69 61 | 74 65 64 20 64 61 74 61 | associa|ted data|
|00005420| 20 73 74 72 75 63 74 75 | 72 65 73 20 61 72 65 20 | structu|res are |
|00005430| 61 6c 6c 20 69 6e 73 74 | 61 6c 6c 65 64 20 69 6e |all inst|alled in|
|00005440| 20 74 68 65 20 73 79 73 | 74 65 6d 20 68 65 61 70 | the sys|tem heap|
|00005450| 2e 20 20 49 66 20 79 6f | 75 72 20 64 72 69 76 65 |. If yo|ur drive|
|00005460| 72 20 75 73 65 73 20 6d | 65 6d 6f 72 79 20 73 74 |r uses m|emory st|
|00005470| 61 74 69 63 61 6c 6c 79 | 20 61 6c 6c 6f 63 61 74 |atically| allocat|
|00005480| 65 64 20 61 62 6f 76 65 | 20 42 75 66 50 74 72 2c |ed above| BufPtr,|
|00005490| 20 69 74 20 6d 61 79 20 | 6e 65 65 64 20 74 6f 20 | it may |need to |
|000054a0| 65 78 70 6c 69 63 69 74 | 6c 79 20 68 6f 6c 64 20 |explicit|ly hold |
|000054b0| 74 68 65 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 |the appr|opriate |
|000054c0| 72 61 6e 67 65 73 20 6f | 66 20 6d 65 6d 6f 72 79 |ranges o|f memory|
|000054d0| 20 74 6f 20 61 76 6f 69 | 64 20 70 61 67 69 6e 67 | to avoi|d paging|
|000054e0| 20 61 74 20 69 6e 74 65 | 72 72 75 70 74 20 74 69 | at inte|rrupt ti|
|000054f0| 6d 65 2e 20 20 50 6c 65 | 61 73 65 20 62 65 20 61 |me. Ple|ase be a|
|00005500| 77 61 72 65 20 74 68 61 | 74 20 66 75 74 75 72 65 |ware tha|t future|
|00005510| 20 76 65 72 73 69 6f 6e | 73 20 6f 66 20 74 68 65 | version|s of the|
|00005520| 20 4d 61 63 69 6e 74 6f | 73 68 20 53 79 73 74 65 | Macinto|sh Syste|
|00005530| 6d 20 53 6f 66 74 77 61 | 72 65 20 6d 61 79 20 6e |m Softwa|re may n|
|00005540| 6f 74 20 68 6f 6c 64 20 | 61 6c 6c 20 6f 66 20 74 |ot hold |all of t|
|00005550| 68 65 20 73 79 73 74 65 | 6d 20 68 65 61 70 20 61 |he syste|m heap a|
|00005560| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 61 6e 64 |utomatic|ally and|
|00005570| 20 69 74 20 69 73 20 61 | 20 67 6f 6f 64 20 68 61 | it is a| good ha|
|00005580| 62 69 74 20 74 6f 20 68 | 6f 6c 64 20 65 78 70 6c |bit to h|old expl|
|00005590| 69 63 69 74 6c 79 20 6d | 65 6d 6f 72 79 20 79 6f |icitly m|emory yo|
|000055a0| 75 20 6b 6e 6f 77 20 79 | 6f 75 20 61 63 63 65 73 |u know y|ou acces|
|000055b0| 73 20 61 74 20 69 6e 74 | 65 72 72 75 70 74 20 74 |s at int|errupt t|
|000055c0| 69 6d 65 2e 0d 54 68 65 | 20 44 65 76 69 63 65 20 |ime..The| Device |
|000055d0| 4d 61 6e 61 67 65 72 20 | 64 65 61 6c 73 20 77 69 |Manager |deals wi|
|000055e0| 74 68 20 5f 52 65 61 64 | 20 61 6e 64 20 5f 57 72 |th _Read| and _Wr|
|000055f0| 69 74 65 20 63 61 6c 6c | 73 20 66 6f 72 20 79 6f |ite call|s for yo|
|00005600| 75 2c 20 61 6e 64 20 65 | 6e 73 75 72 65 73 20 74 |u, and e|nsures t|
|00005610| 68 61 74 20 74 68 65 20 | 62 75 66 66 65 72 73 20 |hat the |buffers |
|00005620| 73 70 65 63 69 66 69 65 | 64 20 66 6f 72 20 73 75 |specifie|d for su|
|00005630| 63 68 20 63 61 6c 6c 73 | 20 61 72 65 20 73 61 66 |ch calls| are saf|
|00005640| 65 2e 20 20 48 6f 77 65 | 76 65 72 2c 20 69 66 20 |e. Howe|ver, if |
|00005650| 61 20 62 75 66 66 65 72 | 20 69 73 20 70 61 73 73 |a buffer| is pass|
|00005660| 65 64 20 61 73 20 61 20 | 63 73 50 61 72 61 6d 20 |ed as a |csParam |
|00005670| 74 6f 20 5f 53 74 61 74 | 75 73 20 6f 72 20 5f 43 |to _Stat|us or _C|
|00005680| 6f 6e 74 72 6f 6c 20 63 | 61 6c 6c 73 2c 20 74 68 |ontrol c|alls, th|
|00005690| 65 20 44 65 76 69 63 65 | 20 4d 61 6e 61 67 65 72 |e Device| Manager|
|000056a0| 20 63 61 6e 6e 6f 74 20 | 64 6f 20 61 6e 79 74 68 | cannot |do anyth|
|000056b0| 69 6e 67 20 61 62 6f 75 | 74 20 69 74 2e 20 20 42 |ing abou|t it. B|
|000056c0| 75 66 66 65 72 73 20 72 | 65 66 65 72 65 6e 63 65 |uffers r|eference|
|000056d0| 64 20 74 68 69 73 20 77 | 61 79 20 6d 75 73 74 20 |d this w|ay must |
|000056e0| 62 65 20 68 65 6c 64 20 | 65 78 70 6c 69 63 69 74 |be held |explicit|
|000056f0| 6c 79 20 69 66 20 74 68 | 65 79 20 61 72 65 20 74 |ly if th|ey are t|
|00005700| 6f 20 62 65 20 61 63 63 | 65 73 73 65 64 20 62 79 |o be acc|essed by|
|00005710| 20 69 6e 74 65 72 72 75 | 70 74 2d 6c 65 76 65 6c | interru|pt-level|
|00005720| 20 63 6f 64 65 2e 0d 43 | 65 72 74 61 69 6e 20 63 | code..C|ertain c|
|00005730| 6f 64 65 20 74 79 70 65 | 73 20 61 72 65 20 61 6c |ode type|s are al|
|00005740| 77 61 79 73 20 64 65 66 | 65 72 72 65 64 20 75 6e |ways def|erred un|
|00005750| 74 69 6c 20 74 69 6d 65 | 73 20 77 68 65 6e 20 70 |til time|s when p|
|00005760| 61 67 69 6e 67 20 69 73 | 20 73 61 66 65 2c 20 61 |aging is| safe, a|
|00005770| 6e 64 20 61 73 20 73 75 | 63 68 20 64 6f 6e d5 74 |nd as su|ch don.t|
|00005780| 20 68 61 76 65 20 74 6f | 20 62 65 20 63 6f 6e 63 | have to| be conc|
|00005790| 65 72 6e 65 64 20 61 62 | 6f 75 74 20 77 68 65 74 |erned ab|out whet|
|000057a0| 68 65 72 20 6d 65 6d 6f | 72 79 20 74 68 65 79 20 |her memo|ry they |
|000057b0| 74 6f 75 63 68 20 69 73 | 20 67 75 61 72 61 6e 74 |touch is| guarant|
|000057c0| 65 65 64 20 74 6f 20 62 | 65 20 68 65 6c 64 2e 20 |eed to b|e held. |
|000057d0| 20 54 68 6f 73 65 20 63 | 6f 64 65 20 74 79 70 65 | Those c|ode type|
|000057e0| 73 20 69 6e 63 6c 75 64 | 65 20 44 65 76 69 63 65 |s includ|e Device|
|000057f0| 20 4d 61 6e 61 67 65 72 | 20 49 2f 4f 20 63 6f 6d | Manager| I/O com|
|00005800| 70 6c 65 74 69 6f 6e 20 | 72 6f 75 74 69 6e 65 73 |pletion |routines|
|00005810| 2c 20 54 69 6d 65 20 4d | 61 6e 61 67 65 72 20 74 |, Time M|anager t|
|00005820| 61 73 6b 73 2c 20 56 42 | 4c 20 74 61 73 6b 73 2c |asks, VB|L tasks,|
|00005830| 20 61 6e 64 20 73 6c 6f | 74 20 56 42 4c 20 74 61 | and slo|t VBL ta|
|00005840| 73 6b 73 2e 20 20 54 68 | 65 20 74 72 61 64 65 2d |sks. Th|e trade-|
|00005850| 6f 66 66 20 69 73 20 69 | 6e 20 72 65 61 6c 2d 74 |off is i|n real-t|
|00005860| 69 6d 65 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 2e |ime perf|ormance.|
|00005870| 20 20 43 6c 65 61 72 6c | 79 2c 20 73 69 6e 63 65 | Clearl|y, since|
|00005880| 20 74 68 65 73 65 20 74 | 61 73 6b 73 20 6d 61 79 | these t|asks may|
|00005890| 20 62 65 20 64 65 66 65 | 72 72 65 64 2c 20 74 68 | be defe|rred, th|
|000058a0| 65 72 65 20 69 73 20 61 | 6e 20 69 6e 63 72 65 61 |ere is a|n increa|
|000058b0| 73 65 64 20 70 6f 73 73 | 69 62 69 6c 69 74 79 20 |sed poss|ibility |
|000058c0| 6f 66 20 6c 61 74 65 6e | 63 79 20 77 68 69 63 68 |of laten|cy which|
|000058d0| 20 6d 61 79 20 62 65 20 | 75 6e 61 63 63 65 70 74 | may be |unaccept|
|000058e0| 61 62 6c 65 20 66 6f 72 | 20 73 6f 6d 65 20 70 73 |able for| some ps|
|000058f0| 65 75 64 6f d0 72 65 61 | 6c 2d 74 69 6d 65 20 61 |eudo.rea|l-time a|
|00005900| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 20 20 28 54 |pplicati|ons. (T|
|00005910| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 20 68 61 73 |he Macin|tosh has|
|00005920| 20 6e 65 76 65 72 20 73 | 75 70 70 6f 72 74 65 64 | never s|upported|
|00005930| 20 74 72 75 65 20 72 65 | 61 6c 2d 74 69 6d 65 20 | true re|al-time |
|00005940| 70 72 6f 63 65 73 73 69 | 6e 67 2e 29 20 20 41 6e |processi|ng.) An|
|00005950| 20 61 72 62 69 74 72 61 | 72 79 20 66 75 6e 63 74 | arbitra|ry funct|
|00005960| 69 6f 6e 20 77 68 69 63 | 68 20 6d 69 67 68 74 20 |ion whic|h might |
|00005970| 63 61 75 73 65 20 61 20 | 70 61 67 65 20 66 61 75 |cause a |page fau|
|00005980| 6c 74 20 61 74 20 69 6e | 74 65 72 72 75 70 74 20 |lt at in|terrupt |
|00005990| 74 69 6d 65 20 63 61 6e | 20 62 65 20 64 65 66 65 |time can| be defe|
|000059a0| 72 72 65 64 20 65 78 70 | 6c 69 63 69 74 6c 79 20 |rred exp|licitly |
|000059b0| 62 79 20 63 61 6c 6c 69 | 6e 67 20 69 74 20 76 69 |by calli|ng it vi|
|000059c0| 61 20 74 68 65 20 74 72 | 61 70 20 5f 44 65 66 65 |a the tr|ap _Defe|
|000059d0| 72 55 73 65 72 46 6e 2e | 0d 54 68 65 20 5f 44 65 |rUserFn.|.The _De|
|000059e0| 66 65 72 55 73 65 72 46 | 6e 20 74 72 61 70 20 69 |ferUserF|n trap i|
|000059f0| 73 20 61 73 79 6e 63 68 | 72 6f 6e 6f 75 73 20 69 |s asynch|ronous i|
|00005a00| 6e 20 6e 61 74 75 72 65 | 2c 20 73 6f 20 73 75 62 |n nature|, so sub|
|00005a10| 73 65 71 75 65 6e 74 20 | 63 6f 64 65 20 6d 61 79 |sequent |code may|
|00005a20| 20 62 65 20 65 78 65 63 | 75 74 65 64 20 62 65 66 | be exec|uted bef|
|00005a30| 6f 72 65 20 74 68 65 20 | 64 65 66 65 72 72 65 64 |ore the |deferred|
|00005a40| 20 66 75 6e 63 74 69 6f | 6e 20 63 6f 6d 70 6c 65 | functio|n comple|
|00005a50| 74 65 73 2e 20 20 49 66 | 20 74 68 65 20 72 65 73 |tes. If| the res|
|00005a60| 75 6c 74 73 20 6f 66 20 | 61 20 64 65 66 65 72 72 |ults of |a deferr|
|00005a70| 65 64 20 66 75 6e 63 74 | 69 6f 6e 20 61 72 65 20 |ed funct|ion are |
|00005a80| 76 69 74 61 6c 20 74 6f | 20 74 68 65 20 63 6f 64 |vital to| the cod|
|00005a90| 65 20 77 68 69 63 68 20 | 66 6f 6c 6c 6f 77 73 2c |e which |follows,|
|00005aa0| 20 74 68 65 20 64 65 66 | 65 72 72 65 64 20 66 75 | the def|erred fu|
|00005ab0| 6e 63 74 69 6f 6e 20 6e | 65 65 64 73 20 74 6f 20 |nction n|eeds to |
|00005ac0| 73 69 67 6e 61 6c 20 74 | 68 65 20 63 61 6c 6c 69 |signal t|he calli|
|00005ad0| 6e 67 20 63 6f 64 65 20 | 77 68 65 6e 20 69 74 20 |ng code |when it |
|00005ae0| 63 6f 6d 70 6c 65 74 65 | 73 2e 0d 41 70 70 6c 65 |complete|s..Apple|
|00005af0| 20 44 65 73 6b 74 6f 70 | 20 42 75 73 20 49 2f 4f | Desktop| Bus I/O|
|00005b00| 20 72 65 71 75 65 73 74 | 73 20 61 72 65 20 64 65 | request|s are de|
|00005b10| 66 65 72 72 65 64 20 75 | 6e 74 69 6c 20 61 20 74 |ferred u|ntil a t|
|00005b20| 69 6d 65 20 77 68 65 6e | 20 70 61 67 69 6e 67 20 |ime when| paging |
|00005b30| 69 73 20 73 61 66 65 20 | 75 6e 6c 65 73 73 20 56 |is safe |unless V|
|00005b40| 4d 20 69 73 20 63 65 72 | 74 61 69 6e 20 74 68 61 |M is cer|tain tha|
|00005b50| 74 20 61 6c 6c 20 63 6f | 64 65 20 61 6e 64 20 61 |t all co|de and a|
|00005b60| 73 73 6f 63 69 61 74 65 | 64 20 64 61 74 61 20 73 |ssociate|d data s|
|00005b70| 74 72 75 63 74 75 72 65 | 73 20 61 72 65 20 6c 6f |tructure|s are lo|
|00005b80| 63 61 74 65 64 20 69 6e | 20 74 68 65 20 73 79 73 |cated in| the sys|
|00005b90| 74 65 6d 20 68 65 61 70 | 2e 20 20 54 68 69 73 20 |tem heap|. This |
|00005ba0| 69 73 20 72 65 71 75 69 | 72 65 64 20 62 65 63 61 |is requi|red beca|
|00005bb0| 75 73 65 20 74 68 65 20 | 41 44 42 20 4d 61 6e 61 |use the |ADB Mana|
|00005bc0| 67 65 72 20 6e 6f 72 6d | 61 6c 6c 79 20 70 72 6f |ger norm|ally pro|
|00005bd0| 63 65 73 73 65 73 20 69 | 6e 63 6f 6d 69 6e 67 20 |cesses i|ncoming |
|00005be0| 64 61 74 61 20 61 74 20 | 69 6e 74 65 72 72 75 70 |data at |interrup|
|00005bf0| 74 20 74 69 6d 65 20 61 | 6e 64 20 74 68 65 72 65 |t time a|nd there|
|00005c00| 20 69 73 20 61 20 70 6f | 74 65 6e 74 69 61 6c 20 | is a po|tential |
|00005c10| 66 6f 72 20 70 61 67 65 | 20 66 61 75 6c 74 73 20 |for page| faults |
|00005c20| 69 66 20 74 68 65 20 73 | 65 72 76 69 63 65 20 72 |if the s|ervice r|
|00005c30| 6f 75 74 69 6e 65 20 63 | 6f 64 65 20 6f 72 20 6f |outine c|ode or o|
|00005c40| 74 68 65 72 20 64 61 74 | 61 20 73 74 72 75 63 74 |ther dat|a struct|
|00005c50| 75 72 65 73 20 61 72 65 | 20 6e 6f 74 20 68 65 6c |ures are| not hel|
|00005c60| 64 20 69 6e 20 72 65 61 | 6c 20 6d 65 6d 6f 72 79 |d in rea|l memory|
|00005c70| 2e 20 20 54 68 65 20 6f | 6e 6c 79 20 70 72 6f 62 |. The o|nly prob|
|00005c80| 6c 65 6d 20 77 69 74 68 | 20 74 68 69 73 20 73 74 |lem with| this st|
|00005c90| 72 61 74 65 67 79 20 69 | 73 20 72 65 64 75 63 65 |rategy i|s reduce|
|00005ca0| 64 20 70 65 72 66 6f 72 | 6d 61 6e 63 65 20 66 6f |d perfor|mance fo|
|00005cb0| 72 20 73 70 65 63 69 61 | 6c 69 7a 65 64 20 41 44 |r specia|lized AD|
|00005cc0| 42 20 64 72 69 76 65 72 | 73 20 77 68 69 63 68 20 |B driver|s which |
|00005cd0| 72 65 71 75 69 72 65 20 | 6d 6f 73 74 20 6f 66 20 |require |most of |
|00005ce0| 74 68 65 20 41 44 42 20 | 62 61 6e 64 77 69 64 74 |the ADB |bandwidt|
|00005cf0| 68 20 61 6e 64 20 64 6f | 6e d5 74 20 6c 69 76 65 |h and do|n.t live|
|00005d00| 20 69 6e 20 74 68 65 20 | 73 79 73 74 65 6d 20 68 | in the |system h|
|00005d10| 65 61 70 2e 20 20 4e 6f | 6e 65 74 68 65 6c 65 73 |eap. No|netheles|
|00005d20| 73 2c 20 69 74 d5 73 20 | 77 6f 72 74 68 20 6d 65 |s, it.s |worth me|
|00005d30| 6e 74 69 6f 6e 69 6e 67 | 2e 0d 4f 6e 65 20 66 69 |ntioning|..One fi|
|00005d40| 6e 61 6c 20 6e 6f 74 65 | 20 6f 66 20 69 6e 74 65 |nal note| of inte|
|00005d50| 72 65 73 74 20 70 65 72 | 74 61 69 6e 73 20 74 6f |rest per|tains to|
|00005d60| 20 61 20 6c 6f 6e 67 73 | 74 61 6e 64 69 6e 67 20 | a longs|tanding |
|00005d70| 61 6e 6f 6d 61 6c 79 20 | 69 6e 20 74 68 65 20 44 |anomaly |in the D|
|00005d80| 65 76 69 63 65 20 4d 61 | 6e 61 67 65 72 2e 20 20 |evice Ma|nager. |
|00005d90| 41 73 20 69 74 20 74 75 | 72 6e 73 20 6f 75 74 2c |As it tu|rns out,|
|00005da0| 20 77 68 65 6e 20 79 6f | 75 20 6d 61 6b 65 20 61 | when yo|u make a|
|00005db0| 6e 20 61 73 79 6e 63 68 | 72 6f 6e 6f 75 73 20 5f |n asynch|ronous _|
|00005dc0| 4f 70 65 6e 20 6f 72 20 | 5f 43 6c 6f 73 65 20 63 |Open or |_Close c|
|00005dd0| 61 6c 6c 20 74 6f 20 61 | 20 64 65 76 69 63 65 20 |all to a| device |
|00005de0| 64 72 69 76 65 72 2c 20 | 61 6e 79 20 63 6f 6d 70 |driver, |any comp|
|00005df0| 6c 65 74 69 6f 6e 20 72 | 6f 75 74 69 6e 65 20 79 |letion r|outine y|
|00005e00| 6f 75 20 73 75 70 70 6c | 79 20 69 73 20 6e 65 76 |ou suppl|y is nev|
|00005e10| 65 72 20 63 61 6c 6c 65 | 64 2e 20 20 53 69 6e 63 |er calle|d. Sinc|
|00005e20| 65 20 56 69 72 74 75 61 | 6c 20 4d 65 6d 6f 72 79 |e Virtua|l Memory|
|00005e30| 20 70 61 74 63 68 65 73 | 20 5f 4f 70 65 6e 20 61 | patches| _Open a|
|00005e40| 6e 64 20 5f 43 6c 6f 73 | 65 2c 20 61 6e 64 20 67 |nd _Clos|e, and g|
|00005e50| 65 6e 65 72 61 74 65 73 | 20 61 6e 20 65 6e 74 72 |enerates| an entr|
|00005e60| 79 20 66 6f 72 20 74 68 | 65 20 63 6f 6d 70 6c 65 |y for th|e comple|
|00005e70| 74 69 6f 6e 20 72 6f 75 | 74 69 6e 65 20 69 6e 20 |tion rou|tine in |
|00005e80| 74 68 65 20 75 73 65 72 | 20 66 75 6e 63 74 69 6f |the user| functio|
|00005e90| 6e 20 71 75 65 75 65 2c | 20 74 68 65 20 69 6d 70 |n queue,| the imp|
|00005ea0| 6c 69 63 61 74 69 6f 6e | 20 69 73 20 74 68 61 74 |lication| is that|
|00005eb0| 20 74 68 65 20 75 73 65 | 72 20 66 75 6e 63 74 69 | the use|r functi|
|00005ec0| 6f 6e 73 20 61 72 65 20 | 6e 65 76 65 72 20 65 78 |ons are |never ex|
|00005ed0| 65 63 75 74 65 64 20 61 | 6e 64 20 74 68 65 20 71 |ecuted a|nd the q|
|00005ee0| 75 65 75 65 20 6d 61 79 | 20 73 69 6d 70 6c 79 20 |ueue may| simply |
|00005ef0| 66 69 6c 6c 20 75 70 2e | 20 20 54 68 65 72 65 20 |fill up.| There |
|00005f00| 69 73 20 6c 69 74 74 6c | 65 20 72 65 61 73 6f 6e |is littl|e reason|
|00005f10| 20 74 6f 20 63 61 6c 6c | 20 5f 4f 70 65 6e 20 6f | to call| _Open o|
|00005f20| 72 20 5f 43 6c 6f 73 65 | 20 61 73 79 6e 63 68 72 |r _Close| asynchr|
|00005f30| 6f 6e 6f 75 73 6c 79 20 | 77 69 74 68 20 61 20 63 |onously |with a c|
|00005f40| 6f 6d 70 6c 65 74 69 6f | 6e 20 72 6f 75 74 69 6e |ompletio|n routin|
|00005f50| 65 20 28 69 74 20 6e 65 | 76 65 72 20 77 6f 75 6c |e (it ne|ver woul|
|00005f60| 64 20 68 61 76 65 20 61 | 6d 6f 75 6e 74 65 64 20 |d have a|mounted |
|00005f70| 74 6f 20 61 6e 79 74 68 | 69 6e 67 20 61 6e 79 77 |to anyth|ing anyw|
|00005f80| 61 79 29 2c 20 73 6f 20 | 74 68 65 20 77 6f 72 6b |ay), so |the work|
|00005f90| 61 72 6f 75 6e 64 20 69 | 73 20 73 69 6d 70 6c 65 |around i|s simple|
|00005fa0| 3a 20 64 6f 6e d5 74 20 | 64 6f 20 69 74 2e 0d 43 |: don.t |do it..C|
|00005fb0| 6f 6d 70 61 74 69 62 69 | 6c 69 74 79 20 57 69 74 |ompatibi|lity Wit|
|00005fc0| 68 20 74 68 65 20 42 75 | 66 50 74 72 20 4d 65 74 |h the Bu|fPtr Met|
|00005fd0| 68 6f 64 20 6f 66 20 53 | 74 61 74 69 63 20 41 6c |hod of S|tatic Al|
|00005fe0| 6c 6f 63 61 74 69 6f 6e | 0d 49 6e 73 69 64 65 20 |location|.Inside |
|00005ff0| 4d 61 63 69 6e 74 6f 73 | 68 2c 20 56 6f 6c 75 6d |Macintos|h, Volum|
|00006000| 65 20 49 56 20 64 65 73 | 63 72 69 62 65 73 2c 20 |e IV des|cribes, |
|00006010| 6f 6e 20 70 61 67 65 20 | 32 35 37 2c 20 61 20 6d |on page |257, a m|
|00006020| 65 74 68 6f 64 20 6f 66 | 20 73 74 61 74 69 63 20 |ethod of| static |
|00006030| 61 6c 6c 6f 63 61 74 69 | 6f 6e 20 66 6f 72 20 72 |allocati|on for r|
|00006040| 65 73 69 64 65 6e 74 20 | 64 72 69 76 65 72 73 20 |esident |drivers |
|00006050| 6f 72 20 6f 74 68 65 72 | 20 64 61 74 61 20 73 74 |or other| data st|
|00006060| 72 75 63 74 75 72 65 73 | 2e 20 20 54 68 69 73 20 |ructures|. This |
|00006070| 6d 65 74 68 6f 64 20 68 | 61 73 20 62 65 65 6e 20 |method h|as been |
|00006080| 76 65 72 79 20 70 6f 70 | 75 6c 61 72 20 77 69 74 |very pop|ular wit|
|00006090| 68 20 61 20 6e 75 6d 62 | 65 72 20 6f 66 20 64 65 |h a numb|er of de|
|000060a0| 76 65 6c 6f 70 65 72 73 | 2e 20 20 54 68 65 20 6d |velopers|. The m|
|000060b0| 61 69 6e 20 74 68 69 6e | 67 20 66 6f 72 20 64 65 |ain thin|g for de|
|000060c0| 76 65 6c 6f 70 65 72 73 | 20 74 6f 20 72 65 6d 65 |velopers| to reme|
|000060d0| 6d 62 65 72 20 61 62 6f | 75 74 20 74 68 69 73 20 |mber abo|ut this |
|000060e0| 6d 65 74 68 6f 64 20 69 | 6e 20 63 6f 6e 6a 75 6e |method i|n conjun|
|000060f0| 63 74 69 6f 6e 20 77 69 | 74 68 20 56 4d 20 69 73 |ction wi|th VM is|
|00006100| 20 74 68 61 74 20 6d 65 | 6d 6f 72 79 20 61 6c 6c | that me|mory all|
|00006110| 6f 63 61 74 65 64 20 69 | 6e 20 74 68 69 73 20 77 |ocated i|n this w|
|00006120| 61 79 20 69 73 20 6e 6f | 74 20 68 65 6c 64 20 69 |ay is no|t held i|
|00006130| 6e 20 70 68 79 73 69 63 | 61 6c 20 6d 65 6d 6f 72 |n physic|al memor|
|00006140| 79 20 62 79 20 64 65 66 | 61 75 6c 74 2e 20 20 49 |y by def|ault. I|
|00006150| 74 20 6d 75 73 74 20 62 | 65 20 65 78 70 6c 69 63 |t must b|e explic|
|00006160| 69 74 6c 79 20 68 65 6c | 64 2c 20 75 6e 6c 69 6b |itly hel|d, unlik|
|00006170| 65 20 6d 65 6d 6f 72 79 | 20 69 6e 20 74 68 65 20 |e memory| in the |
|00006180| 73 79 73 74 65 6d 20 68 | 65 61 70 20 77 68 69 63 |system h|eap whic|
|00006190| 68 20 74 68 65 20 6f 70 | 65 72 61 74 69 6e 67 20 |h the op|erating |
|000061a0| 73 79 73 74 65 6d 20 61 | 75 74 6f 6d 61 74 69 63 |system a|utomatic|
|000061b0| 61 6c 6c 79 20 68 6f 6c | 64 73 2c 20 61 74 20 6c |ally hol|ds, at l|
|000061c0| 65 61 73 74 20 69 6e 20 | 74 68 65 20 66 69 72 73 |east in |the firs|
|000061d0| 74 20 72 65 6c 65 61 73 | 65 20 6f 66 20 53 79 73 |t releas|e of Sys|
|000061e0| 74 65 6d 20 53 6f 66 74 | 77 61 72 65 20 37 2e 30 |tem Soft|ware 7.0|
|000061f0| 2e 0d 57 68 65 6e 20 61 | 6c 6c 6f 63 61 74 69 6e |..When a|llocatin|
|00006200| 67 20 6d 65 6d 6f 72 79 | 20 61 62 6f 76 65 20 42 |g memory| above B|
|00006210| 75 66 50 74 72 2c 20 61 | 6c 77 61 79 73 20 75 73 |ufPtr, a|lways us|
|00006220| 65 20 74 68 65 20 65 71 | 75 61 74 69 6f 6e 20 64 |e the eq|uation d|
|00006230| 65 66 69 6e 65 64 20 69 | 6e 20 49 6e 73 69 64 65 |efined i|n Inside|
|00006240| 20 4d 61 63 69 6e 74 6f | 73 68 2e 20 20 54 68 65 | Macinto|sh. The|
|00006250| 20 61 63 74 75 61 6c 20 | 63 6f 6e 66 69 67 75 72 | actual |configur|
|00006260| 61 74 69 6f 6e 20 6f 66 | 20 6d 65 6d 6f 72 79 20 |ation of| memory |
|00006270| 61 74 20 62 6f 6f 74 20 | 74 69 6d 65 20 69 73 20 |at boot |time is |
|00006280| 6d 75 63 68 20 6d 6f 72 | 65 20 63 6f 6d 70 6c 69 |much mor|e compli|
|00006290| 63 61 74 65 64 20 74 68 | 61 6e 20 74 68 65 20 69 |cated th|an the i|
|000062a0| 6c 6c 75 73 74 72 61 74 | 69 6f 6e 20 69 6e 64 69 |llustrat|ion indi|
|000062b0| 63 61 74 65 73 2c 20 65 | 73 70 65 63 69 61 6c 6c |cates, e|speciall|
|000062c0| 79 20 77 69 74 68 20 53 | 79 73 74 65 6d 20 53 6f |y with S|ystem So|
|000062d0| 66 74 77 61 72 65 20 37 | 2e 30 20 61 6e 64 20 56 |ftware 7|.0 and V|
|000062e0| 4d 2e 20 20 54 68 65 20 | 53 79 73 74 65 6d 20 37 |M. The |System 7|
|000062f0| 2e 30 20 62 6f 6f 74 20 | 63 6f 64 65 20 70 61 73 |.0 boot |code pas|
|00006300| 73 65 73 20 61 20 73 70 | 65 63 69 61 6c 6c 79 2d |ses a sp|ecially-|
|00006310| 63 6f 6e 64 69 74 69 6f | 6e 65 64 20 76 65 72 73 |conditio|ned vers|
|00006320| 69 6f 6e 20 6f 66 20 4d | 65 6d 54 6f 70 20 74 6f |ion of M|emTop to|
|00006330| 20 73 79 73 74 65 6d 20 | 65 78 74 65 6e 73 69 6f | system |extensio|
|00006340| 6e 73 2c 20 77 68 69 63 | 68 20 67 75 61 72 61 6e |ns, whic|h guaran|
|00006350| 74 65 65 73 20 74 68 61 | 74 20 74 68 65 20 65 71 |tees tha|t the eq|
|00006360| 75 61 74 69 6f 6e 20 68 | 61 73 20 76 61 6c 69 64 |uation h|as valid|
|00006370| 20 72 65 73 75 6c 74 73 | 2e 20 20 46 6f 72 20 74 | results|. For t|
|00006380| 68 69 73 20 72 65 61 73 | 6f 6e 2c 20 64 6f 20 6e |his reas|on, do n|
|00006390| 6f 74 20 75 73 65 20 4d | 65 6d 54 6f 70 20 74 6f |ot use M|emTop to|
|000063a0| 20 64 65 74 65 72 6d 69 | 6e 65 20 74 68 65 20 61 | determi|ne the a|
|000063b0| 63 74 75 61 6c 20 6d 65 | 6d 6f 72 79 20 73 69 7a |ctual me|mory siz|
|000063c0| 65 20 6f 66 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |e of the| machine|
|000063d0| 3b 20 75 73 65 20 5f 47 | 65 73 74 61 6c 74 20 69 |; use _G|estalt i|
|000063e0| 6e 73 74 65 61 64 2e 20 | 20 59 6f 75 20 6d 61 79 |nstead. | You may|
|000063f0| 20 75 73 65 20 4d 65 6d | 54 6f 70 20 74 6f 20 64 | use Mem|Top to d|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.